-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2293b91
commit 3f3438e
Showing
4 changed files
with
72 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#pragma warning disable | ||
|
||
// ReSharper disable RedundantUsingDirective | ||
// ReSharper disable PartialTypeWithSinglePart | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
#if PolyPublic | ||
public | ||
#endif | ||
static partial class PolyString | ||
{ | ||
public static string Join(char separator, string[] values) | ||
{ | ||
#if NETSTANDARD2_0 || NETFRAMEWORK | ||
return string.Join(new(new[]{separator}), values); | ||
#else | ||
return string.Join(separator, values); | ||
#endif | ||
} | ||
|
||
public static string Join(char separator, object[] values) | ||
{ | ||
#if NETSTANDARD2_0 || NETFRAMEWORK | ||
return string.Join(new(new[]{separator}), values); | ||
#else | ||
return string.Join(separator, values); | ||
#endif | ||
} | ||
|
||
public static string Join (char separator, string?[] value, int startIndex, int count) | ||
{ | ||
#if NETSTANDARD2_0 || NETFRAMEWORK | ||
return string.Join(new(new[]{separator}), value, startIndex, count); | ||
#else | ||
return string.Join(separator, value, startIndex, count); | ||
#endif | ||
} | ||
|
||
public static string Join<T> (char separator, IEnumerable<T> values) | ||
{ | ||
#if NETSTANDARD2_0 || NETFRAMEWORK | ||
return string.Join(new(new[]{separator}), values); | ||
#else | ||
return string.Join(separator, values); | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// ReSharper disable PartialTypeWithSinglePart | ||
|
||
[TestFixture] | ||
partial class PolyStringTest | ||
{ | ||
[Test] | ||
public void Join() | ||
{ | ||
Assert.AreEqual("bac", PolyString.Join('a', new []{"b","c"})); | ||
Assert.AreEqual("bac", PolyString.Join('a', new object[]{"b","c"})); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters