mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
632 B
23 lines
632 B
namespace Humanizer.Inflections; |
|
|
|
using CharSpan = System.ReadOnlySpan<System.Char>; |
|
|
|
/// <summary> |
|
/// Contains extension methods for humanizing string values. |
|
/// </summary> |
|
internal static class StringHumanizeExtensions |
|
{ |
|
internal static unsafe string Concat(CharSpan left, CharSpan right) |
|
{ |
|
var result = new string('\0', left.Length + right.Length); |
|
fixed (char* pResult = result) |
|
{ |
|
left.CopyTo(new(pResult, left.Length)); |
|
right.CopyTo(new(pResult + left.Length, right.Length)); |
|
} |
|
return result; |
|
} |
|
|
|
internal static unsafe string Concat(char left, CharSpan right) => |
|
Concat(new CharSpan(&left, 1), right); |
|
} |