RE: Slice sequence--new algorithm
- Posted by Al Getz <Xaxo at aol.com> Feb 21, 2001
- 386 views
Hi Derek, You reminded me of a routine i coded quite a while back and forgot about! All i used it for was to remove spaces. It should be quite fast for low target char to other char ratios. Here it is: --removes all occurances of n from s: p=find(n,s) while p do s=s[1..p-1]&s[p+1..length(s)] p=find(n,s) end while Too bad Euphoria doesnt allow 'while (p=find(n,s))>0' or it would shorten the routine even more: --cant do this in euphoria? while p=find(n,s) do s=s[1..p-1]&s[p+1..length(s)] end while Have fun with it! --Al