コード例 #1
0
		/// <summary>
		/// Returns all indivual lines (separated by CR, LF or CRLF).
		/// </summary>
		/// <param name="source">The string </param>
		/// <returns>A sequence of individual lines.</returns>
		public static IEnumerable<string> GetAllLines(this string source)
		{
			if ( source == null )
				yield break;

			using ( var reader = new StringReader(source) )
				foreach ( var line in reader.GetAllLines() )
					yield return line;
		}