Platforms to show: All Mac Windows Linux Cross-Platform

Back to StringMBS class.

StringMBS.Append(other as StringViewMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends the new text to the current text.
Example
Var s As New StringMBS
Var v As New StringViewMBS("Hello")
var t as New StringViewMBS("World")

s.append(v)
s.append(" ")
s.append(t)

MessageBox s.StringValue

See also:

StringMBS.Append(other as StringViewMBS) as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends the new text to the current text.
Example
Var s As New StringMBS
Var v As New StringViewMBS("Hello")
var t as New StringViewMBS("World")

s = s.append(v)
s = s.append(" ")
s = s.append(t)

MessageBox s.StringValue

See also:

StringMBS.Append(other as StringViewMBS, pos as Integer, length as Integer = -1)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends the given range of a text to the current text.
Example
Var s As New StringMBS("Hello World")
Var t as New StringMBS

t.append(s, 2, 5)

MessageBox t.StringValue

See also:

StringMBS.Append(value as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends the new text to the current text.
Example
Var s As New StringMBS

s.Reserve(20)
s.append("Hello")
s.append(" ")
s.append("World")

MessageBox s.StringValue

See also:

StringMBS.Append(value as String) as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends the new text to the current text.

See also:

StringMBS.Assign(value as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Assigns the value of the string to the string view.

We copy the content into the StringMBS object.

See also:

StringMBS.Assign(value as StringViewMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Assigns the string view to point to the content of the existing one.

We copy the content into the StringMBS object.

See also:

StringMBS.Character(Index as Integer) as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
property String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Set or query a character in the string.
Example
Var s As New StringMBS("Hello")

s.Character(0) = 73

MessageBox s.StringValue

(Read and Write computed property)

StringMBS.Clear

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Clears the content.
Example
Var s As New StringMBS("Hello")
s.Clear

If s.Empty Then
MessageBox "is empty"
Else
Break // failed?
End If

StringMBS.Clone as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copies the text into a new string object.
Example
Var s As New StringMBS("Hello")
var c as StringMBS = s.Clone

MessageBox c.StringValue

StringMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.
Example
var n as new StringMBS

See also:

StringMBS.Constructor(value as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.
Example
Var s As New StringMBS("Hello")

MessageBox s.StringValue

See also:

StringMBS.Constructor(value as StringViewMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The copy constructor.
Example
Var s As New StringMBS("Hello")
var n as new StringMBS(s)

MessageBox s.StringValue

See also:

StringMBS.Erase(pos as Integer = 0, length as Integer = -1)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Erases characters from the string.
Example
Var s As New StringMBS("Hello World")

s.erase(2, 5)

MessageBox s.StringValue

StringMBS.Insert(pos as Integer, other as StringViewMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inserts text at the given position.

See also:

StringMBS.Insert(pos as Integer, other as StringViewMBS, spos as Integer, length as Integer = -1)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inserts text at the given position.
Example
Var s As New StringMBS("Held")
var t as new StringMBS("xxxllo Worxxx")

s.Insert(2, t, 3, 7)

MessageBox s.StringValue

See also:

StringMBS.Insert(pos as Integer, value as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inserts text at the given position.
Example
Var s As New StringMBS("Held")

s.Insert(2, "llo Wor")

MessageBox s.StringValue

See also:

StringMBS.Operator_Add(other as StringViewMBS) as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends text to the string.
Example
Var s As New StringMBS
Var v As New StringViewMBS("Hello")
var t as New StringViewMBS("World")

s = s + v
s = s + " "
s = s + t

MessageBox s.StringValue

We return self here and don't create a copy.

See also:

StringMBS.Operator_Add(value as String) as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends text to the string.
Example
Var s As New StringMBS

s = s + "Hello"
s = s + " "
s = s + "World"

MessageBox s.StringValue

We return self here and don't create a copy.

See also:

StringMBS.PopBack

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes the last character.

StringMBS.PushBack(c as UInt32)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds a character to the end of the string.

StringMBS.RemovePrefix(Characters as integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes characters on the start of the string.

Effectively moves start pointer and reduces length.

StringMBS.RemoveSuffix(Characters as integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes characters on the end of the string.

Effectively reduces length.

StringMBS.Replace(find as StringMBS, text as StringMBS) as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces a text in the text with a new text.
Example
Var s As New StringMBS("Hello")
var c as StringMBS = s.Replace(New StringMBS("l"), New StringMBS("o"))

MessageBox c.StringValue

Replaces only once.
There is a faster code path, when source and destination are only one character.
Returns original text if find text is empty.

See also:

StringMBS.Replace(pos as Integer, length as Integer, text as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces a range of text in the string with a new text.
Example
Var s As New StringMBS("Hello")

s.Replace(1,1,"a")

MessageBox s.StringValue

See also:

StringMBS.Replace(pos as Integer, length as Integer, text as StringViewMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces a range of text in the string with a new text.

See also:

StringMBS.ReplaceAll(find as StringMBS, text as StringMBS) as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Replaces all texts with a new text.
Example
Var s As New StringMBS("Hello")
var c as StringMBS = s.ReplaceAll(New StringMBS("l"), New StringMBS("o"))

MessageBox c.StringValue

There is a faster code path, when source and destination are only one character.
Returns original text if find text is empty.

StringMBS.Reserve(amount as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reserves memory for the string.
Example
Var s As New StringMBS

MessageBox s.Capacity.ToString+" capacity, "+s.Length.ToString+" length"

s.Reserve(1000)
MessageBox s.Capacity.ToString+" capacity, "+s.Length.ToString+" length"

s.Append "Hello World"
MessageBox s.Capacity.ToString+" capacity, "+s.Length.ToString+" length"

StringMBS.Resize(amount as Integer, Character as UInt32 = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Resizes the string to the given size.
Example
Var s As New StringMBS("Hello")
s.Resize(3)

MessageBox s.StringValue

Either appends characters with the given codepoint or reduces the length.

StringMBS.ShrinkToFit

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Shrinks memory allocation to the required space.
Example
Var s As New StringMBS

s.Reserve(1000)
s.Append "Hello World"

// 1001 characters allocated
MessageBox s.Capacity.ToString

s.ShrinkToFit

// now only 11 characters allocated
MessageBox s.Capacity.ToString

Requests the removal of unused capacity.

StringMBS.SubString(Pos as Integer, Length as Integer = -1) as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns a substring on the given range.

Th text is copied into a new text object.
If length is omitted or -1, we return until the end of the string.

StringMBS.Swap(other as StringMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Swaps content of two string objects.

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...