# Function Reference

StringStripWS

Strips the white space in a string.

StringStripWS ( "string", flag )

Parameters

string | The string to strip.
flag | Flag to indicate the type of stripping that should be performed (add the flags together for multiple operations): 1 = strip leading white space 2 = strip trailing white space 4 = strip double (or more) spaces between words 8 = strip all spaces (over-rides all other flags)

Return Value

Returns the new string stripped of the requested white space.

Remarks

Whitespace includes Chr(9) thru Chr(13) which are HorizontalTab, LineFeed, VerticalTab, FormFeed, and CarriageReturn. Whitespace also includes the null string ( Chr(0) ) and the standard space ( Chr(32) ).
To strip single spaces between words, use the function StringReplace.
"string" parameter cannot be a binaryString.

Related

StringStripCR, StringIsSpace, StringReplace

Example

$text = StringStripWS(" this is a line of text ", 3)
MsgBox(0, "Stripped from both ends", $text)