Garry's Mod Wiki

Garry's Mod Wiki

  string string.GetChar( string str, number index )

Description

We advise against using this. It may be changed or removed in a future update. Use either string.sub(str, index, index) or str[index].

Returns char value from the specified index in the supplied string.

Arguments

1 string str
The string that you will be searching with the supplied index.
2 number index
The index's value of the string to be returned.

Returns

1 string
str

Example

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

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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...