Garry's Mod Wiki

Garry's Mod Wiki

  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 ,"

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 twice a day. Edits and history are not available.

Last Parsed: Loading...