#region 获取后几位数 public string GetLastStr(string str,int num) /// <summary> /// 获取后几位数 /// </summary> /// <param>要截取的字符串</param> /// <param>返回的具体位数</param> /// <returns>返回功效的字符串</returns> public string GetLastStr(string str, int num) { int count = 0; if (str.Length > num) { count = str.Length - num; str = str.Substring(count, num); } return str; } #endregion
,