> I've got a phone number that will be brought in via Seaside and can be
> in the following format (nnn) xxx-yyyy where everything but the
> parens are
> numbers. I want to convert it back to a fixed point value (e.g.
> nnnxxxyyyy).
>
> Unfortunately, I didn't see any obvious way to do this aside from
> parsing the string.. Is there something similar to sscanf() for
> Smalltalk that I can pass a format string to and have it do the
> dirty work? Thanks!
Rick, this will filter all non-digits:
numbers := myMixedString select: [ :char | char isDigit ].
If you need to separate the different parts of a phone number, you
will however need to parse it. The Package/Parcel "Regex11" has some
nice tools for this. See class comments of RxParser.
Andre
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc