string.SetChar

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

Contents

Description

Sets the character at the specific index of the string.

Arguments

string InputString

The input string

Arguments

number Index

The character index, 1 is the first from left.

Arguments

string ReplacementChar

String to replace with.

Returns

string

ModifiedString

Examples

Example

Demonstrates the use of SetChar

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

Output:

"Apgles"
Personal tools
Navigation