private static ReplaceWithString ( String thisob, String searchString, String replaceString ) : String | ||
thisob | String | |
searchString | String | |
replaceString | String | |
return | String |
public static String replace(Object thisob, Object regExp, Object replacement) { String thisStr = Convert.ToString(thisob); RegExpObject regExpObject = regExp as RegExpObject; if (regExpObject != null) { return(StringPrototype.ReplaceWithRegExp(thisStr, regExpObject, replacement)); } Regex regex = regExp as Regex; if (regex != null) { return(StringPrototype.ReplaceWithRegExp(thisStr, new RegExpObject(regex), replacement)); } return(StringPrototype.ReplaceWithString(thisStr, Convert.ToString(regExp), Convert.ToString(replacement))); }