<< I am trying to remove all double spaces in text in order to replace the remaining single spaces with a comma so that I can use SSUB on the converted string. >>
Spaces (CHAR(32)) are problematical, change the spaces to something more tractable and operate on that string. Here's a solution (SET DEBUG ON to see the intermediate steps). SET VAR vString = (SRPL(.vString, ' ', (CHAR(160)), 0)) WHILE SLOC(.vString, (CHAR(160) + CHAR(160))) > 0 THEN SET VAR vString = (SRPL(.vString, (CHAR(160) + CHAR(160)), CHAR(160), 0)) DEBUG WRITE 'Intermediate String =', .vString ENDWHILE SET VAR vString = (SRPL(.vString, CHAR(160), ',', 0)) DEBUG WRITE 'Final String =', .vString -- Larry

