Platforms to show: All Mac Windows Linux Cross-Platform

Back to StringViewMBS class.

StringViewMBS.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.

The plugin keeps a reference to the string to avoid it being freed too early.

See also:

StringViewMBS.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.

The plugin keeps a reference to the StringViewMBS to avoid it being freed too early.

See also:

StringViewMBS.Character(Index as Integer) as UInt32

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

MessageBox s.Character(0).ToString // 72 for H

StringViewMBS.Characters as UInt32()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates an array with the characters.
Example
Var v As StringViewMBS = StringViewMBS.ViewFromString("Hello")
// let's ger characters
Var Characters() As UInt32 = v.Characters
// inspect in debugger and build to a new string view
Var n As StringViewMBS = StringViewMBS.ViewFromCharacters(Characters)
MessageBox n.StringValue

Copies data into the new array.

StringViewMBS.Compare(value as String) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares two strings.

Returns zero if strings are equal.

See also:

StringViewMBS.Compare(value as StringViewMBS) as Integer

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

Var c1 As Integer = s.Compare(t)
Var c2 As Integer = s.Compare(s)
Var c3 As Integer = t.Compare(s)

Break

Returns zero if strings are equal.

See also:

StringViewMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.

Creates an empty string view.

See also:

StringViewMBS.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.

Creates a string view looking into the given string.

See also:

StringViewMBS.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 constructor.

Creates a string view copying the existing one.

See also:

StringViewMBS.Contains(value as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks whether the given text is contained in the current view.
Example
Var s As New StringMBS("Hello World!")

If s.Contains("World") Then
MessageBox "found"
Else
Break
End If

Returns true if the given value is found within the string.

See also:

StringViewMBS.Contains(value as StringViewMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks whether the given text is contained in the current view.
Example
Var s As New StringMBS("Hello World!")
var w as new StringMBS("World")

If s.Contains(w) Then
MessageBox "found"
Else
Break
End If

Returns true if the given value is found within the string.
Search is case sensitive.

See also:

StringViewMBS.EndsWith(value as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks if the string ends with the given suffix.
Example
Var s As New StringMBS("Hello World!")

// starts with Hello?
Var b1 As Boolean = s.StartsWith("Hello")
Var b2 As Boolean = s.StartsWith("Hallo")

// ends with World!?
Var b3 As Boolean = s.EndsWith("World!")
Var b4 As Boolean = s.EndsWith("World.")

Break

Returns true if the string ends with the provided suffix, false otherwise.

See also:

StringViewMBS.EndsWith(value as StringViewMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks if the string ends with the given suffix.

Returns true if the string ends with the provided suffix, false otherwise.

See also:

StringViewMBS.Find(value as String, pos as Integer = 0) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Finds the first substring equal to the given character sequence.
Example
Var s As New StringMBS("Hello World!")

Var p1 As Integer = s.Find("World") // 6
Var p2 As Integer = s.Find("test") // -1
Var p3 As Integer = s.Find("") // -1
Var p4 As Integer = s.Find("Hello") // 0

Break

Search begins at pos.
Returns -1 if not found.

See also:

StringViewMBS.Find(value as StringViewMBS, pos as Integer = 0) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Finds the first substring equal to the given character sequence.

Search begins at pos.
Returns -1 if not found.

See also:

StringViewMBS.LowerCase as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Converts all characters to lower case.
Example
// set locale with German
Call SQLGlobalsMBS.Setlocale(SQLGlobalsMBS.LocaleAll, "de_DE")

// and try with this test sentence
Var s As New StringMBS("Ältere Ärzte üben öfters, indem sie Äpfel über Öfen ölen und ärgern.")

Var l As StringMBS = s.Lowercase
Var u As StringMBS = s.Uppercase

// ältere ärzte üben öfters, indem sie äpfel über öfen ölen und ärgern.
Var ll As String = l.StringValue
// ÄLTERE ÄRZTE ÜBEN ÖFTERS, INDEM SIE ÄPFEL ÜBER ÖFEN ÖLEN UND ÄRGERN.
var uu as string = u.StringValue

Break

Needs the locale set.

StringViewMBS.Operator_Compare(value as String) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares two strings and returns result.
Example
Var s As New StringMBS("Hello")
Var t As string = "Hello"

If s = t Then
MessageBox "equal"
End If

Returns 0 for equal and 1 if the value is bigger or -1 if it is smaller.

See also:

StringViewMBS.Operator_Compare(value as StringViewMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares two strings and returns result.
Example
Var s As New StringMBS("Hello")
Var t As New StringMBS("Hallo")

If s = s Then
// okay, same object
Else
// failed
Break
End If

If s = t Then
// failed
Break
Else
// okay
end if

If s > t Then
// okay
Else
// failed
Break
End If

Break

Returns 0 for equal and 1 if the value is bigger or -1 if it is smaller.

See also:

StringViewMBS.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.
Example
Var s As New StringMBS("Hello World!")

s.RemovePrefix 6

MessageBox s.StringValue

Effectively moves start pointer and reduces length.

StringViewMBS.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.
Example
Var s As New StringMBS("Hello World!")

s.RemoveSuffix 6

MessageBox s.StringValue

Effectively reduces length.

StringViewMBS.StartsWith(value as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks if the string begins with the given prefix.
Example
Var s As New StringMBS("Hello World!")

// starts with Hello?
Var b1 As Boolean = s.StartsWith("Hello")
Var b2 As Boolean = s.StartsWith("Hallo")

// ends with World!?
Var b3 As Boolean = s.EndsWith("World!")
Var b4 As Boolean = s.EndsWith("World.")

Break

Returns true if the string begins with the provided prefix, false otherwise.

See also:

StringViewMBS.StartsWith(value as StringViewMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks if the string begins with the given prefix.

Returns true if the string begins with the provided prefix, false otherwise.

See also:

StringViewMBS.SubView(Pos as Integer, Length as Integer = -1) as StringViewMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns a sub view on the given range.
Example
Var s As New StringMBS("Hello")

var v as StringViewMBS = s.SubView(2,2)

MessageBox v.StringValue

The text is not copied, but references.
If length is omitted or -1, we return until the end of the string.

StringViewMBS.Swap(other as StringViewMBS)

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.

StringViewMBS.ToData as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a MemoryBlock with a copy of the data.
Example
Var v As StringMBS = StringMBS.StringFromString("Hello")
// let's ger characters as MemoryBlock
Var data as MemoryBlock = v.ToData
// inspect in debugger and build to a new string view
Var n As StringMBS = StringMBS.StringFromData(Data)
MessageBox n.StringValue

Copies the data into a new MemoryBlock.
The MemoryBlock must contain UTF-32 characters (4 bytes per character).

StringViewMBS.UpperCase as StringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method String MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Converts all characters to upper case.
Example
// set locale with German
Call SQLGlobalsMBS.Setlocale(SQLGlobalsMBS.LocaleAll, "de_DE")

// and try with this test sentence
Var s As New StringMBS("Ältere Ärzte üben öfters, indem sie Äpfel über Öfen ölen und ärgern.")

Var l As StringMBS = s.Lowercase
Var u As StringMBS = s.Uppercase

// ältere ärzte üben öfters, indem sie äpfel über öfen ölen und ärgern.
Var ll As String = l.StringValue
// ÄLTERE ÄRZTE ÜBEN ÖFTERS, INDEM SIE ÄPFEL ÜBER ÖFEN ÖLEN UND ÄRGERN.
var uu as string = u.StringValue

Break

Needs the locale set.

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


The biggest plugin in space...