字串處理

2022-11-24 18:27:06 字數 2062 閱讀 8923

title#region getsubstring

///

/// 取得指定開始和結束字串中間的資料串

///

///

///

///

///

protected string getsubstring(string content, string startstr, string endstr)}}

catch (exception ex)

return string.empty;

}///

/// 取得指定結束字串中間的資料串

///

///

///

///

protected string getsubstring(string content, string endstr)

}catch (exception ex)

return string.empty;

}#endregion

#region replace

///

///

///

///

///

///

///

///

protected string replace(string content, string startstr, string endstr, string newvalue)

///

///

///

///

///

///

///

///

///

protected string replace(string content, string startstr, string endstr, string newvalue, bool onlyreplacefirst)

else}}

catch (exception ex)

return content;

}#endregion#region getsubstring

///

/// 取得指定開始和結束字串中間的資料串

///

///

///

///

///

protected string getsubstring(string content, string startstr, string endstr)}}

catch (exception ex)

return string.empty;

}///

/// 取得指定結束字串中間的資料串

///

///

///

///

protected string getsubstring(string content, string endstr)

}catch (exception ex)

return string.empty;

}#endregion

#region replace

///

///

///

///

///

///

///

///

protected string replace(string content, string startstr, string endstr, string newvalue)

///

///

///

///

///

///

///

///

///

protected string replace(string content, string startstr, string endstr, string newvalue, bool onlyreplacefirst)

else}}

catch (exception ex)

return content;

}#endregion