Platforms to show: All Mac Windows Linux Cross-Platform
Back to StringHandleMBS class.
StringHandleMBS.Add(data as MemoryBlock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
StringHandleMBS.Add(data as Ptr, size as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Using invalid Ptr or size combination can cause a crash.
See also:
StringHandleMBS.Add(data as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Note that all strings added must have the same encoding.
See also:
StringHandleMBS.Add(data as StringHandleMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 22.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Just like asking first StringHandle for content as string or Memoryblock and then adding that to the target one. But without the intermediate copying.
See also:
StringHandleMBS.AddByte(value as UInt8)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
StringHandleMBS.AddInteger(value as Int64)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is like AddString(str(value)).
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 21.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Resets size to zero, but does not release memory, so it can be reused.
StringHandleMBS.clone as StringHandleMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
StringHandleMBS.Constructor(InitValue as MemoryBlock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
StringHandleMBS.Constructor(initvalue as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
StringHandleMBS.Copy as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This string will have the encoding set in the encoding property.
StringHandleMBS.CopyMemory as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
StringHandleMBS.Delete(start as Integer, lengthBytes as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
One based like RB's string functions.
The start and length parameters use bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
StringHandleMBS.Extract(start as Integer, lengthBytes as Integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
One based and the returned part is removed form the string data.
The start and length parameters use bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
StringHandleMBS.FindByte(value as UInt8, StartByteOffset as Integer = 1) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns one based byte offset.
Result is 0 if not found.
StartPosition added in v21.3.
See also:
StringHandleMBS.FindByte(values() as UInt8, StartByteOffset as Integer = 1) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 21.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Values is an array of possible values to find.
For best performance avoid duplicates in that array.
Returns one based byte offset.
Result is 0 if not found.
See also:
StringHandleMBS.FirstNonWhiteSpace(StartByteOffset as Integer = 1) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
StartByteOffset is one based.
White space are space, tab and new line characters.
Returns 0 if not found.
StringHandleMBS.FirstWhiteSpace(StartByteOffset as Integer = 1) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
StartByteOffset is one based.
White space are space, tab and new line characters.
Returns 0 if not found.
StringHandleMBS.Insert(data as string, position as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
One based.
Note that on Unicode the character position and the byte position are not equal!
(On 16bit Unicode charpos=2*bytepos and on US ASCII charpos=bytepos)
The position parameter uses bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
StringHandleMBS.InStr(OffsetBytes as Integer = 1, target as String, EndOffsetBytes as Integer = -1) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The same as InStr but with a second parameter to specify the start of the search inside the string handled.
The srcOfs parameter uses bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
Returns positive value if something is found and zero in case nothing is found.
Returns negative value in case of error.
Casesensitive search!
StringHandleMBS.InStrUTF8(OffsetCharacters as Integer = 1, target as String, EndOffsetCharacters as Integer = -1) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This function uses UTF8 characters instead of bytes as unit.
Returns positive value if something is found and zero in case nothing is found.
Returns negative value in case of error.
The same as InStrUTF8 but with a second parameter to specify the start of the search inside the string handle.
Casesensitive search!
StringHandleMBS.Left(lengthBytes as Integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
May return less strings if the stored string is not long enough.
The length parameter uses bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
StringHandleMBS.LeftUTF8(lengthCharacter as integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
StringHandleMBS.Mid(startByte as Integer, lengthBytes as Integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
One based.
The length parameter uses bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
StringHandleMBS.MidInteger(startByte As Integer, lengthBytes As Integer = -1) as Int64
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
startByte is one based.
StringHandleMBS.MidUTF8(startCharacter as integer, lengthCharacter as integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
startCharacter starts with 1 as in Xojo's mid function.
StringHandleMBS.Replace(a as String, b as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Note that all strings are compared binary and must have the same encoding.
Basicly this is just a call to instr, one to delete and one to insert.
See also:
StringHandleMBS.Replace(startpos as Integer, a as String, b as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If you don't give a startpos parameter the call uses one and is equal to Replace(a,b).
Startpos is one based like all indexes in this class.
The startpos parameter uses bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
See also:
StringHandleMBS.ReplaceAll(a as String, b as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Note that all strings are compared binary and must have the same encoding.
Basicly this is just a loop with calls to instr, to delete and to insert.
See also:
StringHandleMBS.ReplaceAll(startpos as Integer, a as String, b as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If you don't give a startpos parameter the call uses one and is equal to ReplaceAll(a,b).
Startpos is one based like all indexes in this class.
The startpos parameter uses bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
See also:
StringHandleMBS.Reverse as StringHandleMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns copy of the string with reversed order.
StringHandleMBS.Right(lengthBytes as Integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
May return less strings if the stored string is not long enough.
The length parameter uses bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
StringHandleMBS.RightUTF8(lengthCharacter as integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
StringHandleMBS.Truncate(lengthBytes as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Sets the length of the string back to the given value if it's greater.
The length parameter uses bytes not charcters as unit. You can use the Copy method to get a RB string for characterwise editing.
StringHandleMBS.TruncateUTF8(lengthCharacters as integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | String | MBS DataTypes Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
StringHandleMBS.UInt16Value(offset as Integer) as UInt16
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | String | MBS DataTypes Plugin | 21.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Offset is range checked and may raise an OutOfBoundsException.
When you assign a value and the offset is exactly size of the string handle plus one, we append the new byte.
(Read and Write computed property)
The items on this page are in the following plugins: MBS DataTypes Plugin.