removed bug from deque, and added replaceChar call to string
git-svn-id: svn://10.0.0.236/trunk@20767 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1400,6 +1400,28 @@ nsString& nsString::StripWhitespace()
|
||||
return StripChars("\r\t\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to replace all occurances of the
|
||||
* given source char with the given dest char
|
||||
*
|
||||
* @param
|
||||
* @return *this
|
||||
*/
|
||||
nsString& nsString::ReplaceChar(PRUnichar aSourceChar, PRUnichar aDestChar) {
|
||||
PRUnichar* from = mStr;
|
||||
PRUnichar* end = mStr + mLength;
|
||||
|
||||
while (from < end) {
|
||||
PRUnichar ch = *from;
|
||||
if(ch==aSourceChar) {
|
||||
*from = aDestChar;
|
||||
}
|
||||
from++;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for given character within this string.
|
||||
* This method does so by using a binary search,
|
||||
|
||||
Reference in New Issue
Block a user