+ 1
Is it possible to split a line with spaces and cammas at a same time??
2 Antworten
+ 6
You could replace all commas with " " and then split at " ", like this:
print("a b,c".replace(",", " ").split(" "))
Or a regex with you really want that :)
+ 3
Like: <string>.split(", ") ?
Give an example please.