diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-01 19:02:09 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-01 19:02:09 +0200 |
commit | d55416a649346e1d1d40c03284d5bd6f6c0a6384 (patch) | |
tree | 22c8ab292dbdb1af853efb6725e681292750b642 /source/StringUtils.cpp | |
parent | FastNBT: Added cFastNBTTag::GetName() (diff) | |
download | cuberite-d55416a649346e1d1d40c03284d5bd6f6c0a6384.tar cuberite-d55416a649346e1d1d40c03284d5bd6f6c0a6384.tar.gz cuberite-d55416a649346e1d1d40c03284d5bd6f6c0a6384.tar.bz2 cuberite-d55416a649346e1d1d40c03284d5bd6f6c0a6384.tar.lz cuberite-d55416a649346e1d1d40c03284d5bd6f6c0a6384.tar.xz cuberite-d55416a649346e1d1d40c03284d5bd6f6c0a6384.tar.zst cuberite-d55416a649346e1d1d40c03284d5bd6f6c0a6384.zip |
Diffstat (limited to '')
-rw-r--r-- | source/StringUtils.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/StringUtils.cpp b/source/StringUtils.cpp index f3450f620..0143bb8c4 100644 --- a/source/StringUtils.cpp +++ b/source/StringUtils.cpp @@ -106,7 +106,7 @@ AStringVector StringSplit(const AString & str, const AString & delim) while ((cutAt = str.find_first_of(delim, Prev)) != str.npos) { results.push_back(str.substr(Prev, cutAt - Prev)); - Prev = cutAt + delim.length(); + Prev = cutAt + 1; } if (Prev < str.length()) { @@ -118,6 +118,7 @@ AStringVector StringSplit(const AString & str, const AString & delim) + AStringVector StringSplitAndTrim(const AString & str, const AString & delim) { AStringVector results; @@ -126,7 +127,7 @@ AStringVector StringSplitAndTrim(const AString & str, const AString & delim) while ((cutAt = str.find_first_of(delim, Prev)) != str.npos) { results.push_back(TrimString(str.substr(Prev, cutAt - Prev))); - Prev = cutAt + delim.length(); + Prev = cutAt + 1; } if (Prev < str.length()) { |