Get a formatted string.
a = "Iswenzz";
b = 10;
string = fmt("%s %d", a, b);
Trim a string.
string = trim(" hello world ");
Check the condition and return the 1st value if true or the second value if false.
a = Ternary(player.name == "Iswenzz", 1000, 0);
Give a default value if the variable is undefined.
name = IfUndef(player.name, "Unknown player");
Get the type name of a GSC variable.
type = GetType(player.name);
Convert int, float, vector to string.
str = ToString(player.velocity);
Convert string, float, vector to integer.
i = ToInt("123");
Convert string, int, vector to float.
f = ToFloat("1.23");
Check if a string is undefined or empty.
IsNullOrEmpty(player.name);
Check if a string is alphanumeric.
IsStringAlpha("abc123_&");
Check if a string contains a float.
IsStringFloat("123.123");
Check if a string contains an integer.
IsStringInt("123");
Normalize RGB vector.
rgb = ToRGB(125, 255, 255);
Convert a HEX color string to a normalized RGB vector.
rgb = HexToRGB("#AABBCC");
rgb = HexToRGB("AABBCC");
Check if a string starts with a specific value.
StartsWith("hello world", "hello");
Check if a string ends with a specific value.
EndsWith("hello world", "world");
Join string array with a separator.
str = StrJoin(array, "-");
Replace a string.
str = Replace("SR Speedrun", "Speedrun", "Deathrun");
Join filepath strings.
path = StrJoin("C:\\home", "cod4", "speedrun");
path = StrJoin("/home", "cod4", "speedrun");