Boost logo

Boost :

From: jbandela_at_[hidden]
Date: 2001-12-01 01:04:47


This should work

using namespace boost;
string s = "{0 0.23 56 45.456}"
punct_space_separator<char> sep(false,"()");
tokenizer<> tok(s,sep);

The reason this works is that it overrides the default ispunct to
pick delimiters.

Regards,

John R. Bandela

--- In boost_at_y..., dejavous_ie_at_y... wrote:
> Hi all,
> I am using the tokenizer to parse input files and I was wondering
if anyone can tell me how to tokenize a floating point number. When I
use the tokenizer it splits the number at the decimal point and I'm
not sure how to prevent this. I would appreciate it very much if
someone could tell me how to get around this problem.
>
> Some sample input is {0 0.23 56 45.456}.
> It tokenizes this to:
> 0
> 0
> 23
> 56
> 45
> 456
>
> Thanks in advance for any help given.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk