Add a check to split for non-wide strings too
This commit is contained in:
parent
eef55b04f8
commit
65c15fc19a
@ -168,7 +168,7 @@ namespace StringUtils
|
||||
try
|
||||
{
|
||||
std::string::size_type start=0;
|
||||
while(start!=std::string::npos && start<(unsigned int)s.size())
|
||||
while(start < (unsigned int) s.size())
|
||||
{
|
||||
std::string::size_type i=s.find(c, start);
|
||||
if (i!=std::string::npos)
|
||||
@ -186,11 +186,11 @@ namespace StringUtils
|
||||
}
|
||||
else // end of string reached
|
||||
{
|
||||
if (keepSplitChar)
|
||||
if (keepSplitChar && start != 0)
|
||||
result.push_back(std::string(s,start-1));
|
||||
else
|
||||
result.push_back(std::string(s,start));
|
||||
start = i;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -251,7 +251,6 @@ namespace StringUtils
|
||||
result.push_back( s.subString(start, s.size()-start) );
|
||||
|
||||
return result;
|
||||
//start = i+1;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user