-
Richard Hartman
- PowerBuilder
- Friday, 7 February 2025 08:58 PM UTC
I want to parse a string based on whitespace. This can be either spaces or tabs.
Pos() seems to be able to match only one at a time.
Match() will allow a regex, allowing a search for either ... but only returns true/false and not the position.
Is my only option to do Pos() twice (once for space, once for tab) and then take the lower of the two values as the end position of my next token? And what if I need to also parse for carraige return and/or newline (~r ~n) ... I would have to do Pos() four times!?!
(for comparison, consider the old C function strtok() which allows for a LIST of delimiters)
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.