- assign(buf);
- return *this;
-}
-
-///////////////////////////////////////// eString replaceChars(char, char) /////////////////////////////
-eString& eString::removeChars(char fchar)
-{
-// Remove all chars that equal to fchar, and returns a reference to itself
- unsigned int index=0;
-
- while ( ( index = find(fchar, index) ) != npos )
- erase(index, 1);
-
- return *this;
-}
-
-/////////////////////////////////////// eString upper() ////////////////////////////////////////////////
-eString& eString::upper()
-{
-// convert all lowercase characters to uppercase, and returns a reference to itself
- for (iterator it = begin(); it != end(); it++)
- switch(*it)
- {
- case 'a' ... 'z' :
- *it -= 32;
- break;
-
- case 'ä' :
- *it = 'Ä';
- break;
-
- case 'ü' :
- *it = 'Ü';
- break;
-
- case 'ö' :
- *it = 'Ö';
- break;
- }
-
- return *this;
-}
-
-eString& eString::strReplace(const char* fstr, const eString& rstr)
-{
-// replace all occurrence of fstr with rstr and, and returns a reference to itself
- unsigned int index=0;
- unsigned int fstrlen = strlen(fstr);
- int rstrlen=rstr.size();
-
- while ( ( index = find(fstr, index) ) != npos )
- {
- replace(index, fstrlen, rstr);
- index+=rstrlen;
- }
-
- return *this;
-}
-
-int strnicmp(const char *s1, const char *s2, int len)
-{
-// makes a case insensitive string compare with len Chars
- while ( *s1 && *s2 && len-- )
- if ( tolower(*s1) != tolower(*s2) )
- return tolower(*s1) < tolower(*s2) ? -1 : 1;
- else
- s1++, s2++;
-
- return 0;
-}
-
-/////////////////////////////////////// eString icompare(const eString&) ////////////////////////////////////////////////
-int eString::icompare(const eString& s)
-{
-// makes a case insensitive string compare
- std::string::const_iterator p = begin(),
- p2 = s.begin();
-
- while ( p != end() && p2 != s.end() )
- if ( tolower(*p) != tolower(*p2) )
- return tolower(*p) < tolower(*p2) ? -1 : 1;
- else
- p++, p2++;
-
- return length() == s.length() ? 0 : length() < s.length() ? -1 : 1;