public static ReplaceOnce ( StringBuilder text, string oldValue, string newValue ) : bool | ||
text | StringBuilder | Text to be processed |
oldValue | string | Text to be replaced |
newValue | string | Replacement text |
return | bool |
public static bool ReplaceOnce(StringBuilder text, string oldValue, string newValue)
{
int index = text.ToString().IndexOf(oldValue);
if (index < 0)
return false;
text.Replace(oldValue, newValue, index, oldValue.Length);
return true;
}
Tools::ReplaceOnce ( string &text, string oldValue, string newValue ) : bool |