string.GetChar

From Garry's Mod
Jump to: navigation, search
 string.GetChar( )

Contents

Description

This feature is deprecated.
You should avoid using it as it may be removed in a future version.

Use either string.sub(str, index, index) or str[index].
Returns char value from the specified index in the supplied string.

Arguments

string str

The string that you will be searching with the supplied index.

Arguments

number index

The index's value of the string to be returned.

Returns

string

str

Examples

Example

Looks index in the supplied string and returns value of that index.

local char = "ABC"
print(string.GetChar(char, 2))

Output:


B
Personal tools
Navigation