Use std::string::substr() instead of adding one character at a time. This patch also removes a few unused util functions that are easily written using substr().

This commit is contained in:
Jason Orendorff
2013-10-25 02:42:12 -07:00
parent 727529fe0b
commit 83af1b1c5a
3 changed files with 3 additions and 38 deletions

View File

@@ -5,21 +5,6 @@ std::string intToString(int theInt) {
converter << theInt;
return converter.str();
}
std::string truncateEnd(std::string to_truncate)
{
std::string to_return = "";
for (unsigned int i = 0; i < to_truncate.length()-1; i++)
to_return = to_return + to_truncate[i];
return to_return;
}
std::string removeBeginning(std::string to_remove)
{
std::string to_return = "";
for (unsigned int i = 1; i < to_remove.length(); i++)
to_return = to_return + to_remove[i];
return to_return;
}
std::string replaceExEscape(std::string first, std::string search, std::string replace) {
size_t pos = 0;