-
Notifications
You must be signed in to change notification settings - Fork 0
/
StringEnumerablePlus.cs
57 lines (50 loc) · 2.09 KB
/
StringEnumerablePlus.cs
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.Collections.Generic;
namespace System.Linq;
/// <summary>
/// Enumerable Plus Extensions
/// </summary>
public static partial class EnumerablePlus
{
/// <summary>
/// Concatenates the members of a collection, using the specified separator between each member.
/// </summary>
/// <param name="values"></param>
/// <param name="separator"></param>
public static string JoinString<T>(this IEnumerable<T> values, char separator) =>
string.Join(separator, values);
/// <summary>
/// Concatenates the members of a collection, using the specified separator between each member.
/// </summary>
/// <param name="values"></param>
/// <param name="separator"></param>
public static string JoinString<T>(this IEnumerable<T> values, string separator) =>
string.Join(separator, values);
/// <summary>
/// Concatenates the members of a collection, using the specified separator between each member.
/// </summary>
/// <param name="values"></param>
/// <param name="separator"></param>
public static string JoinNewString(this IEnumerable<char> values, char separator) =>
string.Join(separator, values);
/// <summary>
/// Concatenates the members of a collection, using the specified separator between each member.
/// </summary>
/// <param name="values"></param>
/// <param name="separator"></param>
public static string JoinNewString(this IEnumerable<char> values, string separator) =>
string.Join(separator, values);
/// <summary>
/// Concatenates the members of a constructed IEnumerable collection of type String.
/// </summary>
/// <param name="values"></param>
/// <returns></returns>
public static string ConcatString(this IEnumerable<string> values) =>
string.Concat(values);
/// <summary>
/// Concatenates the members of a constructed IEnumerable collection of type String.
/// </summary>
/// <param name="values"></param>
/// <returns></returns>
public static string ConcatString(this IEnumerable<char> values) =>
string.Concat(values);
}