String Functions
Built-in string functions

PropertyDescription
CountFields( text As String, delim As String )count the number of fields in 'text', delimited by 'delim'
InStr( text as String, find As String ) As Integerfind 1-based character position of 'find' within 'text'; return 0 if not found
InStr( startPos As Integer, text as String, find As String ) As Integerfind 1-based character position of 'find' within 'text' starting at 'startPos'; return 0 if not found
InStrB( text as String, find As String ) As Integerfind 1-based byte position of 'find' within 'text'; return 0 if not found
InStrB( startPos As Integer, text as String, find As String ) As Integerfind 1-based byte position of 'find' within 'text' starting at 'startPos'; return 0 if not found
Left( s As String, chars As Integer ) As Stringget the leftmost portion of the string (specified in characters)
LeftB( s As String, bytes As Integer ) As Stringget the leftmost portion of the string (specified in bytes)
Len( s As String ) As Integerget the number of characters in the given string
LenB( s As String ) As Integerget the number of bytes in the given string
Lowercase( text As String ) As Stringconvert all characters in the given string to lower case
LTrim( text As String ) As Stringremove whitespace from the left end of the given string
Mid( s As String, startPos As Integer ) As Stringget the substring from 1-based 'startPos' to the end
Mid( s As String, startPos As Integer, chars As Integer ) As Stringget the substring containing 'chars' characters starting at 'startPos'
MidB( s As String, startPosB As Integer ) As Stringget the substring from 1-based 'startPosB' to the end
MidB( s As String, startPosB As Integer, bytes As Integer ) As Stringget the substring containing 'bytes' bytes starting at 'startPosB'
NthField( text As String, delim As String, fieldNum As Integer ) As Stringget the (1-based) field 'fieldNum' from 'text', delimeted by 'delim'
Replace( s As String, find As String, replaceWith As String ) As Stringreplace the first occurrence of 'find' within 's' with 'replaceWith'
ReplaceB( s As String, find As String, replaceWith As String ) As Stringlike Replace, but does a binary match instead of text match
ReplaceAll( s As String, find As String, replaceWith As String ) As Stringreplace all occurrences of 'find' within 's' with 'replaceWith'
ReplaceAllB( s As String, find As String, replaceWith As String ) As Stringlike ReplaceAll, but does a binary match instead of text match
Right( s As String, chars As Integer ) As Stringget the rightmost portion of the string (specified in characters)
RightB( s As String, bytes As Integer ) As Stringget the rightmost portion of the string (specified in bytes)
RTrim( text As String ) As Stringremove whitespace from the right end of the given string
StrComp( s1 As String, s2 As String, mode As Integer ) As Integercompare two strings in sophisticated ways
Titlecase( text As String ) As Stringcapitalize the first letter, and lowercase the subsequent letters, of each word in 'text'
Trim( text As String ) As Stringremove whitespace from both ends of the given string
Uppercase( text As String ) As Stringconvert all characters in the given string to upper case


Yuma features a number of global functions for manipulating strings. Most of them come in two forms: a text-based form (e.g. Left) which takes positions, offsets, and counts in characters, and works only on strings containing proper UTF-8 text; and a binary form (e.g. LeftB) which takes positions, offsets, and counts in bytes, and works on any string. In addition, text-based searches and comparisons (such as done by InStr) are case-insensitive, while binary ones (InStrB) treat the string as just a list of bytes, and so are case sensitive.