String Data Type
Holds a sequence of 8-bit Unicode (UTF-8) characters. A string can contain from zero to TBD characters.
- Default value
- When you declare a variable of type
Stringand leave it uninitialized, its default value is the empty string (
- Type characters
- When you put a dollar sign (
$) at the end of a name, it declares it as a
Shared methods and properties
String.CharAt(str As String, pos As Int) As Char
- Returns the character at the given position in a string.
posis larger than the end of the string, then the method throws
RangeError. If you must do an operation for each character in a string, “
For Each chr As Char In str” could give better results.
String.Default As String
- Returns the default value,
String.Find(str As String, what As String, Optional start As Int, length As Int, flags As FindFlags) As Int String.Find(str As String, what As Char, Optional start As Int, length As Int, flags As FindFlags) As Int
- Returns the position of a substring or character (
what) in a given string. You can optionally supply where to start (
start), how many characters (
length), and how to find the next index (
flags). Values of
String.Lower(str As String) As String
- Returns a string with upper-case letters changed to lower-case.
String.Part(str As String, start As Int, Optional length As Int) As String
- Returns part of a string at a given position (
start), and with a optional given length. If
lengthis not given, then the returned string is from
startthru the end of the given string. If
startis larger than the end of the given string, then the method throws
String.Upper(s As String) As String
- Returns a string with lower-case letters changed to upper-case.
Dim foo As String Dim bar$