码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2016-11-26 11:19:52      阅读:709      评论:0      收藏:0      [点我收藏+]

标签:nal   nali   string   ogr   字符串   namespace   ace   text   static   

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#如何分割多个空格分隔的字符串?

标签:nal   nali   string   ogr   字符串   namespace   ace   text   static   

原文地址:http://www.cnblogs.com/China3S/p/6103707.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!