forked from commandlineparser/commandline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringExtensions.cs
More file actions
26 lines (22 loc) · 838 Bytes
/
StringExtensions.cs
File metadata and controls
26 lines (22 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
namespace CommandLine.Tests
{
static class StringExtensions
{
public static string[] ToNotEmptyLines(this string value)
{
return value.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
}
public static string[] ToLines(this string value)
{
return value.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
}
public static string[] TrimStringArray(this IEnumerable<string> array)
{
return array.Select(item => item.Trim()).ToArray();
}
}
}