Garry's Mod Wiki

Garry's Mod Wiki

  string string.SetChar( string InputString, number Index, string ReplacementChar )

Description

Sets the character at the specific index of the string.

Arguments

1 string InputString
The input string
2 number Index
The character index, 1 is the first from left.
3 string ReplacementChar
String to replace with.

Returns

1 string
ModifiedString

Example

Demonstrates the use of SetChar

local str = "Apples" MsgN(string.SetChar(str, 3, "g"))
Output: "Apgles"

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...