using System;using System.Collections.Generic;using System.Linq;using System.Text;
namespace 分割字符串{ class Program { static void Main(string[] args) { string str1 = "河南,云南,上海,北京,广东"; string[] str2 = new string[2]; char[] sp = { ',', '.' }; str2 = str1.Split(sp); for (int i = 0; i < str2.Length; i++) { Console.WriteLine(str2[i]); } Console.ReadLine(); } }}
为什么会出现没有分割呢???