字符串操作

本示例将一串字符串以空格键分割成数组元素。

using System;
namespace a
{
	class Program
	{
		public static void Main(string[] args)
		{
			string myString ="This is a test.";
			char[] separator={' '};
			string[] myWords;
			myWords=myString.Split(separator);
			foreach (string word in myWords)
			{
				Console.WriteLine("{0}",word);
			}
			Console.ReadKey();
		}
	}
}
原文地址:https://www.cnblogs.com/bimgoo/p/2469007.html