>cString = "xxx yyy zzz" >cString = STRTRAN(cString,SPACE(2),SPACE(1),1,OCCURS(SPACE(2),cString)) >>Regards,
cString = "xxx yyy zzz" do while at( " ", cString ) > 0 cString = strtran( cString, " ", " " ) enddoAs for stripping the other invalid characters you don't want to allow, I would pre-build a string of chars you DONT want, then use CHRTRAN() such as
lcInvalid = "`~!@#$%^&*()-_=+{}[]\|;:,<.>/?'" + '"' cString = "xx@()x] ] ] y]yy@(*!$ zzz" cString = chrtran( cString, lcInvalid, "" )the CHRTRAN() will take the string, look for each character found in lcInvalid, and replace it with the character in the same position in parameter 3 (which empty will result in no character and thus cut out of the string).