strstrip
The strstrip function strips one or both emclosing characters and then trims leading and trailing blanks. If no enclosing characters are matched, only preceding and trailing blanks are stripped. Note that only the leading and trailing characters (if specified) are stripped, hence an embedded leading or trailing character is not removed.
sNewString = strstrip( sString, sLead, sTrail ) |
sString is
the string to be processed.
sLead is
the optional leading character to be stripped.
sTrail is
the optional trailing character to be stripped.
sNewString
is the result.
sNewString = nil if not a string.
The scripts below show several cases of stripping termain characters and blanks. Note that only the leading and trailin:
|
-- string with [] and blanks |
|
- prints new=John ny |
|
|
|
-- string with end blanks |
|
- prints new=John ny / |
|
|
|
-- string |
|
- prints new='John ny ' / |
|
|
|
-- not a string |
|
-- prints new='John 'ny ' / |
Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.