FBWiki : KeyPgOpStringIndex

FBWiki :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Operator [] (String index)


Returns a reference to a character in a string

Syntax:


Usage:
result = lhs [ rhs ]

Parameters:
lhs
The string.
rhs
A zero-based offset from the first character.
T
The wide-character type (varies per platform).

Description:
This operator returns a reference to a specific character in a string.

The user must ensure that the index does not exceed the range "[0, Len(lhs) - 1]". Outside this range, results are undefined.

Examples:
Dim a As String = "Hello, world!"
Dim i As Integer

For i = 0 To Len(a) - 1
    Print Chr(a[i]);
Next i
Print


Will print
Hello, world!


Differences from QB:

See also:

Back to Indexing Operators
Back to Operators

There is one comment on this page. [Display comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.0



sf.net phatcode