public static string Replease(string originalStr, string repleasStr, string newStr)
{
int pos = originalStr.IndexOf(repleasStr);
int len = repleasStr.Length;
if (pos != -1)
{
string strLeft = originalStr.Substring(0, pos);
string strRight = originalStr.Substring(pos + len);
return strLeft + newStr + strRight;
}
else
return originalStr;
}
沒有留言:
張貼留言