private static ReplaceWithRegExp ( String thisob, |
||
thisob | String | |
regExpObject | ||
replacement | Object | |
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))); }