string s = "30112118617"; if (s.Length > 9) s = s.Remove(9); // now, s is 301121186
string s = "30112118617"; int maxLength = 9; if(s.Length > maxLength) { s = s.Substring(0, maxLength); }
string S="30112118617"; if (S.Length > 9) { int x = S.Length - 9; S = S.Substring(0, S.Length - x); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)