I want to count the leading spaces in a string. I can sort of do it, as shown in the sample below, but the core of the problem seems to be finding the first non-blank character. It seems like there must be a better way than specifying a list of 127 printable characters and then finding any one of them. I don't want to find "something," but rather "anything" as long as it is NOT a blank.
Thank you.
R E B O L []
;;;;; 1 2 3
;;;;; 123456789*123456789*123456789*
STR: " XXXXXXXX YYYYY"
NONBLANK: charset "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
FIRST-NONBLANK: index? find STR NONBLANK
LEADING-SPACES: FIRST-NONBLANK - 1
REST-OF-STRING: at STR FIRST-NONBLANK
print ["String value: " REST-OF-STRING]
print ["Leading spaces: " LEADING-SPACES]
halt