Garry's Mod Wiki

string.SetChar

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"

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 4
Generate Html 7
SaveChanges (1) 9
Render Body 0
Render Sidebar 10