Onetastic Macro Documentation >
>
>
String_Trim String_Trim
Removes whitespace (or other characters) from the beginning and/or end of a string and returns the resulting string.
Syntax
String String_Trim(
String string,
String characters,
String trimDirection)
Parameters
- String string
- String to be trimmed.
- String characters
- Set of characters to be trimmed. If left empty, following characters will be removed: Space (ASCII 32), Tab (ASCII 9), New Line (ASCII 10), Carriage Return (ASCII 13), Vertical Tab (ASCII 11).
- String trimDirection
- Direction of the trim. Can be "left", "right" or "both".
Examples
$string = " The quick brown fox
"
String_Trim($string, "", "left")
String_Trim($string, "", "right")
String_Trim($string, "", "both")
String_Trim("The quick brown fox", "Txohef ", "both")
|