Garry's Mod Wiki

string.Trim

string string.Trim( string Inputstring, string Char = "%s" )

Description

Removes leading and trailing matches of a string.

Arguments

1 string Inputstring
The string to trim.
2 string Char = "%s"
String to match - can be multiple characters. Matches spaces by default.

Returns

1 string
Modified string

Example

Demonstrates the use of string. Trim without second argument.

MsgN(string.Trim(" hi whatsup "))
Output: "hi whatsup"

Example

Trim with longer strings as second argument.

MsgN(string.Trim("you cant be serious ,you", "you"))
Output: " cant be serious ,"

Page Links


Special Pages


Wikis

?

Render Time: 39ms

DB GetPage 5
Generate Html 3
SaveChanges (1) 15
Render Body 0
Render Sidebar 13