标签:
/// <summary> /// 取左边文本 /// </summary> /// <param name="SumString">总文本</param> /// <param name="LeftString">左边文本</param> /// <returns>找到返回取出的左边文本,没找到返回空</returns> public static string GetLeftString(string SumString, string LeftString) { if (string.IsNullOrEmpty(SumString)) return ""; if (string.IsNullOrEmpty(LeftString)) return ""; int LeftIndex = SumString.IndexOf(LeftString); if (LeftIndex == -1) return ""; return SumString.Substring(0, LeftIndex + LeftString.Length-1); }
标签:
原文地址:http://www.cnblogs.com/xiaomihu/p/5819835.html