On Mon, Jan 11, 2010 at 2:33 AM, sudhir prasad <sudheer....@gmail.com> 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 of characters use str.split(). To split on any one of a collection of characters use re.split(). Note that if you pass multiple characters to str.split(), the string is split on occurrences of the multiple character string, not on occurrences of any character in the string. So for multiple character arguments, str.split() is not equivalent to strtok(). Kent _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor