Returns the specified string with the leading and/or trailing white space removed.
Parameters:
s
The original string.
left
Specifies removing of the leading white space (default true
).
right
Specifies removing of the trailing white space (default true
).
Returns:
The new string with the removed leading/trailing white space.Note: When both
left
andright
parameters arefalse
, the function returns the original string.
Tip:
This function may be called in a method-like style:
s.trim() s.trim(true, false)