Re: How does StreamTokenizer work
Dave Rathnow wrote:
> I have a text string of hex values separated by
> whitespaces and I would like to read them using a
> StreamTokenizer. For example:
> String hexString = "0b ab ff 33 56"
> I've been trying to figure out how to do it but haven't
> had any luck. Can someone tell me how I setup a StreamTokenizer
> to give me each hex value? That is, "0b" then "ab" then "ff"
Wrap your hex string in a StringReader and feed it to the
StreamTokenizer. Set the decimal digit characters to be ordinary, and
then to be word characters. (That combination removes the "numeric"
attribute from those characters.) Happy parsing.
|All times are GMT. The time now is 10:26 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.