首页 > 代码库 > C#如何分割多个空格分隔的字符串?

C#如何分割多个空格分隔的字符串?

using System;using System.Text;using System.Text.RegularExpressions;namespace test{	class Program	{		public static void Main(string[] args)		{			string pp="1063792.4  2764405.825  5.464413E-05     -1.780467E-04";			string[] mm=Regex.Split(pp,"\\s+",RegexOptions.IgnoreCase);			for (int i=0;i<mm.Length;i++)			{				Console.Write(mm[i]+‘\n‘);			}						// TODO: Implement Functionality Here						Console.Write("Press any key to continue . . . ");			Console.ReadKey(true);		}	}}

  

C#如何分割多个空格分隔的字符串?