String

From REALbasicWiki

Jump to: navigation, search

String is a datatype used for storing a series of zero or more characters. These can be alphabetic, numeric or other printable or non-printable characters.

The size of the variable is dependant on the contents of the string.

The default value is the empty string ""

REALbasic strings are immutable, so each time a new string is assigned to a string variable, new memory is assigned internally for the variable and the previously allocated memory is released.

[edit] Discussion

To be useful as text, it is normally necessary to know the Encoding associated with a string.

The ConvertEncoding and DefineEncoding functions are useful for this, as is the TextEncoding class

[edit] Sample Code

 Dim s As String = "Hello, World!"
Personal tools
related