StringsEx
Previous  Next

The StringsEx object provides the following methods and properties


Methods

New1 : Creates a new StringEx object.

VB style functions

Left(oldstring As String, newlength As Int32) :  Returns a string containing the leftmost newlength characters of oldstring.

Mid(oldstring As String, newlength As Int32, startchar As Int32) :  Returns a string containing newlength characters starting at startchar from oldstring.

Right(oldstring As String, newlength As Int32) :  Returns a string containing the rightmost newlength characters of oldstring.

Trimming functions

Trim(oldstring As String) : Returns a new string with left and right whitespace trimmed from oldstring.

TrimChars(oldstring As String, trimchars As Char()) : Returns a new string with all of the characters in the Char array, trimchars(), trimmed from each end of oldstring.

TrimLeftChars(oldstring As String, trimchars As Char()) : Returns a new string with all of the characters in the Char array, trimchars(), trimmed from the left of oldstring.

TrimRightChars(oldstring As String, trimchars As Char()) : Returns a new string with all of the characters in the Char array, trimchars(), trimmed from the right of oldstring.

Padding functions

PadLeft(oldstring As String, newlength As Int32,  padchar As Char) :   Returns a new string of newlength padded on the left with padchar. Padchar can be a character, e.g. Char(52), or a string containing a single character, e.g.  "c".

PadRight(oldstring As String, newlength As Int32,  padchar As Char) :   Returns a new string of newlength padded on the right with padchar. Padchar can be a character, e.g. Char(52), or a string containing a single character, e.g.  "c".      
            
Indexing functions

IndexOfChars(oldstring As String, indexchars As Char()) : Returns the index of the first occurrence in this instance of any character in the indexchars() array of characters.

LastIndexOf(oldstring As String, substring As String, startpos As Int32) : Returns the index of the last occurrence in oldstring of substring looking backwards from startpos.

LastIndexOfChars(oldstring As String, indexchars As Char())  : Returns the index of the last occurrence in oldstring of any character in the indexchars() array of characters looking backwards from the end of the string.

Miscellaneous functions

EndsWith(mainstring As String, substring As String) : Returns True if mainstring ends with substring.

Join(stringarray() As String, joinstring As String,) : Returns a single string consisting af all the strings in stringarray concatenated with joinstring between the elements of stringarray. Joinstring can be a null string, "", to directly concatenate all the elements of stringarrays

Reverse(oldstring As String) : Returns a new string containing the characters of oldstring in reverse order.

StartsWith(mainstring As String, substring As String) : Returns True if mainstring starts with substring.

ToCharArray (mainstring As String) : Returns the characters of mainstring as an array of characters. Note that the BinaryFile library can convert strings to and from Byte arrays.


Property

I signifies readable, O signifies settable.

Dllversion : Double [I] : Gets the version number of this library.