Split QString with multi-character separator: Strange behavior
Solved
General and Desktop
-
I have an input string like this:
"RelationID";"FilePath";"ContentType"
and would like to split it into three items:- RelationID
- FilePath
- ContentType
I first remove the leading an trailing double quote and then do:
myStringList = myString.split(""";""");
The actual output looks like this:
- RelationID"
- "FilePath"
- "ContentType
(note the extra double quotes).
I thought the separator parts are removed on split. Any ideas?
-
Did you try with:
myStringList = myString.split("\";\"");
-
This:
""";"""
actually means: empty string + ";" + empty string