[Solved] Using Python to split long string, by given ‘separators’ [duplicate]
[ad_1] If you want to split by any instance of any of those separators, you may want a regular expression: r = re.compile(r’|’.join(separators)) r.split(s) Note that this is not a safe way to build regexps in general; it only works here because I know that none of your separators contain any special characters. If you … Read more