These functions will remove a range of defined chars before or after a string. The behavior in that is similar to LTRIM$/RTRIM$, but these functions are not limited to remove spaces and have different modes.
SYNTAX:
stripped$ = LStrip$ (mode%, arg$) stripped$ = RStrip$ (mode%, arg$)
INPUTS:
mode% (INTEGER)
- Any of the operation mode constants defined in the global CONSTs section in the dev_framework\GuiAppFrame.bi file (see also below).
arg$ (STRING)
- The string you want to strip out, may be a fixed length string or user type string element too.
RESULT:
stripped$ (STRING)
- The given arg$ with all defined chars before or after it removed, depending on the used function.
MODE CONSTANTS:
stripZERO%
- remove zeros (CHR$(0))
stripTAB%
- remove tabulators (CHR$(9))
stripSPACE%
- just like LTRIM$/RTRIM$ (remove spaces)
stripQUOTE%
- remove quotation marks (CHR$(34))
stripFIX%
- trim partly uninitialized fixed length strings (remove zeros and spaces)
stripWHITE%
- whitespaces (remove tabulators and spaces)
stripALL%
- all (remove zeros, tabulators, spaces and quotes)
SPECIAL MODES:
stripTEXT%
- Find the real text start/end (ie. remove whitspaces and quotes), use it to remove also in-quoted whitespace (eg. " TEXT " becomes just TEXT after using L- and RStrip$() on it.
stripVALUE%
- Prepare a number string as argument for VAL(...), ie. LStrip$() is to find the first -, +, ., & or digit (0-9), while RStrip$() is to find the first digit (0-9) from the right side.
- Additionally some simple checks are done by LStrip$():
- 1.) & is accepted only if followed by B, H or O (any case)
- 2.) +, - is accepted only if followed by . or digit
- 3.) . accepted only if followed by digit
- However, there is still the chance of misformatted numbers, especially if you don't know the source of the numbers (external input etc.).