#region 移除字符串末尾指定字符 /// <summary> /// 移除字符串末尾指定字符 /// </summary> /// <param name="str">需要移除的字符串</param> /// <param name="value">指定字符</param> /// <returns>移除后的字符串</returns> public static string RemoveLastChar(string str, string value) { int _finded = str.LastIndexOf(value); if (_finded != -1) { return str.Substring(0, _finded); } return str; } #endregion
时间: 2024-12-14 03:30:28