This is brilliant :)

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Sunanda
> Sent: Wednesday, October 07, 2009 6:51 PM
> To: [email protected]
> Subject: [REBOL] Re: Fast way to strip characters
>=20
>=20
>  > what is a *fast* way to strip chars unwanted from a string?
>=20
> The replies so far assume you have an explicit list of the unwanted
> chars.
>=20
> If instead you are starting with a list of conforming chars, and you
> want to remove anything that does not conform, you need a slightly
> different approach.
>=20
> One way is to use 'trim twice:
>=20
>     good-chars: " abcdefhgijklmnopqrstuvwxyz"
>     target: "this: is a string!"
>     trim/with target trim/with copy target good-chars
>     =3D=3D "this is a string"
>=20
> Other ways include using parse with the complement of a bit set. But
> that  may not be forward compatible with R3
>=20
> Sunanda.
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to