public StringBuilder Replace (char oldChar, char newChar, int startIndex, int count)
{
// re-ordered to avoid possible integer overflow
if (startIndex > _length - count || startIndex < 0 || count < 0)
throw new ArgumentOutOfRangeException();
if (null != _cached_str)
InternalEnsureCapacity (_str.Length);
for (int replaceIterate = startIndex; replaceIterate < startIndex + count; replaceIterate++ ) {
if( _str [replaceIterate] == oldChar )
_str.InternalSetChar (replaceIterate, newChar);
}
return this;
}