//如果中间有空格 string str = "湘 A 48499"; str.Replace(" ", "");//去空格 Console.WriteLine(str.Substring(0, 1)); Console.WriteLine(str.Substring(1, 1)); Console.WriteLine(str.Substring(2)); // 或者 string str = "湘 A 48499"; string[] strlist = str.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); Console.WriteLine(strlist[0]); Console.WriteLine(strlist[1]); Console.WriteLine(strlist[2]); //如果没有空格 string str = "湘 A 48499"; Console.WriteLine(str.Substring(0, 1)); Console.WriteLine(str.Substring(1, 1)); Console.WriteLine(str.Substring(2));
var str = "湘A48499"; Console.WriteLine(str.Substring(0, 1)); Console.WriteLine(str.Substring(1, 1)); Console.WriteLine(str.Substring(2));
楼上正解~