Skip to main content

TrimString

TrimString (str [, simplifyInternalSpaces])

The TrimString function returns a string identical to str except that leading and trailing whitespace characters are removed. The whitespace characters are space, tab, carriage-return and linefeed.

If the optional second parameter is non-zero, then each run of whitespace characters between words in str is "simplified" to a single space character.

The TrimString function was added in Igor Pro 7.00.

Examples

Print TrimString("   spaces   at  ends  ")      // Prints "spaces   at  ends"
Print TrimString(" spaces at ends ", 1) // Prints "spaces at ends"

See Also

SplitString, RemoveEnding, ReplaceString