Refactored intToString #4601

This commit is contained in:
Jerry (Xinyu Hou) 2015-05-18 11:27:54 -07:00
parent af73e8280d
commit 70be9cd97f
2 changed files with 14 additions and 1 deletions

View File

@ -207,6 +207,14 @@ removeChar(String& subject, const char c)
subject.erase(std::remove(subject.begin(), subject.end(), c), subject.end()); subject.erase(std::remove(subject.begin(), subject.end(), c), subject.end());
} }
String
intToString(size_t integer)
{
std::stringstream ss;
ss << integer;
return ss.str();
}
// //
// CaselessCmp // CaselessCmp
// //

View File

@ -84,10 +84,15 @@ void uppercase(String& subject);
//! Remove all specific char in suject //! Remove all specific char in suject
/*! /*!
Remove all specific \c char in \c suject Remove all specific \c c in \c suject
*/ */
void removeChar(String& subject, const char c); void removeChar(String& subject, const char c);
//! Convert an integer to a string
/*!
Convert an \c integer to a string
*/
String intToString(size_t integer);
//! Case-insensitive comparisons //! Case-insensitive comparisons
/*! /*!