Xojo Conferences
XDCMay2019MiamiUSA
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

StringHandleMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class String MBS DataTypes Plugin 3.1 Yes Yes Yes Yes No
Function: A class for attaching strings together very fast.
Example:
dim s as StringHandleMBS

s=new StringHandleMBS

// Add some text
s.Add "Hello"
s.Add " "
s.Add "World"

// Insert a string
s.Insert " great",6

// check it
MsgBox s.Copy

// Delete the great from above
s.Delete 6,7

// check
MsgBox s.Copy

// Insert again
s.Insert " great ",6

// check
MsgBox s.Copy

// Now we extract the middle, so it's deleted
MsgBox s.Extract(6,7)

// check again
MsgBox s.copy
Notes: The class initalized itself on the first use.

Feedback, Comments & Corrections

  • 6 properties
  • 26 methods
    • method Add(data as MemoryBlock)
    • method Add(data as Ptr, size as Integer)
    • method Add(data as string)
    • method clone as StringHandleMBS
    • method Constructor
    • method Constructor(initvalue as string)
    • method Copy as string
    • method CopyMemory as MemoryBlock
    • method Delete(start as Integer, length as Integer)
    • method Extract(start as Integer, length as Integer) as string
    • method Insert(data as string, position as Integer)
    • method InStr(srcOfs as Integer, target as String) as Integer
    • method InStr(target as String) as Integer
    • method InStrUTF8(srcOfs as Integer, target as String) as Integer
    • method InStrUTF8(target as String) as Integer
    • method Left(length as Integer) as string
    • method LeftUTF8(lengthCharacter as integer) as string
    • method Mid(start as Integer, length as Integer) as string
    • method MidUTF8(startCharacter as integer, lengthCharacter as integer) as string
    • method Replace(a as String, b as string)
    • method Replace(startpos as Integer, a as String, b as string)
    • method ReplaceAll(a as String, b as string)
    • method ReplaceAll(startpos as Integer, a as String, b as string)
    • method Right(length as Integer) as string
    • method RightUTF8(lengthCharacter as integer) as string
    • method Truncate(length as Integer)
  • 7 constants

Encodings

Constant Value Description
encodingASCII &h0600 ASCII encoding.
encodingBinary &hFFFF No encoding.
encodingLatin1 &h0201 ISO Latin 1 encoding.
encodingMacRoman 0 Mac Roman encoding.
encodingUnicode &h0100 Unicode UTF16 encoding.
encodingUTF8 &h08000100 UTF-8 encoding.
encodingWindows &h0500 Windows encoding.

This class has no sub classes.

Some examples which use this class:

Blog Entries


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


StdoutMBS   -   StringHashSetIteratorMBS




Links
MBS FileMaker Plugins