BadScript 2
Loading...
Searching...
No Matches
StringExtensions.cs
Go to the documentation of this file.
1// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2
3using System;
4using System.Collections.Generic;
5using System.Linq;
6
7namespace CommandLine.Tests
8{
9 static class StringExtensions
10 {
11 public static string[] ToNotEmptyLines(this string value)
12 {
13 return value.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
14 }
15
16 public static string[] ToLines(this string value)
17 {
18 return value.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
19 }
20
21 public static string[] TrimStringArray(this IEnumerable<string> array)
22 {
23 return array.Select(item => item.Trim()).ToArray();
24 }
25 }
26}
static string[] ToLines(this string value)
static string[] TrimStringArray(this IEnumerable< string > array)
static string[] ToNotEmptyLines(this string value)