Title How do I do what strtok () does in C, in Python? assumes it should answer my question, but the specific behavior of strtok () I'm looking for is split into any of the characters of the separator string. That is, given:
const char* delim = ", "; str1 = "123,456"; str2 = "234 567"; str3 = "345, 678";
strtok () finds substrings of digits regardless of the number of characters from delim. The Python partition expects the entire demarcation line to be there, so I cannot do this:
delim = ', ' "123,456".split(delim)
since it does not find delim as a substring and returns a list of one element.
source share