Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Splitting string based on substring separator

From: sunandadh:aol at: 21-Dec-2002 19:19

Frantisek :
> and I want to split it to substrings based on the separator string (in > this case, "sep").
I'm sure you may get more elegant answers, but when I was faced with the same problem, I solved it by replacing the "sep" string with a single character that did not (should not!) appear in the string, I used a hex ff -- so: unlikely-char: to-string to-char 255 original-string: "HELLOsepP E O P L EsepHOWsepAREsepYOU" replace/all original-string "sep" unlikely-char print mold parse/all original-string unlikely-char ["HELLO" "P E O P L E" "HOW" "ARE" "YOU"] Sunanda.