Re: [Tutor] what is the equivalent function to strtok() in c++

2010-01-11 Thread Kent Johnson
On Mon, Jan 11, 2010 at 2:33 AM, sudhir prasad wrote: > hi, > what is the equivalent function to strtok() in c++, > what i need to do is to divide a line into different strings and store them > in different lists,and write them in to another file To split on a single character or a fixed sequence

Re: [Tutor] what is the equivalent function to strtok() in c++

2010-01-11 Thread Alan Gauld
"Stefan Behnel" wrote For more sophisticated functionality use the re module or a specialised parser. Just a quick note here, "specialised parser" might sound like something that's hard to write. It's not. Good point. I meant one of the many existing parsing packages for specific purposes

Re: [Tutor] what is the equivalent function to strtok() in c++

2010-01-11 Thread Stefan Behnel
Alan Gauld, 11.01.2010 10:07: For more sophisticated functionality use the re module or a specialised parser. Just a quick note here, "specialised parser" might sound like something that's hard to write. It's not. There are quite some parser packages available for Python that are easy to use.

Re: [Tutor] what is the equivalent function to strtok() in c++

2010-01-11 Thread Alan Gauld
"Dave Angel" wrote If your tokens are separated by whitespace, you can simply use a single call to split(). It will turn a single string into a list of tokens. line = "Now is the time" print line.split() will display the list: ['Now', 'is', 'the', 'time'] And if it's not separated by

Re: [Tutor] what is the equivalent function to strtok() in c++

2010-01-10 Thread Dave Angel
sudhir prasad wrote: hi, what is the equivalent function to strtok() in c++, what i need to do is to divide a line into different strings and store them in different lists,and write them in to another file If your tokens are separated by whitespace, you can simply use a single call to split(

[Tutor] what is the equivalent function to strtok() in c++

2010-01-10 Thread sudhir prasad
hi, what is the equivalent function to strtok() in c++, what i need to do is to divide a line into different strings and store them in different lists,and write them in to another file ___ Tutor maillist - Tutor@python.org To unsubscribe or change subsc