Files
ILSpy/ICSharpCode.Decompiler/Humanizer/StringHumanizeExtensions.cs
T
Siegfried Pammer 07d5a01d2b Add license headers to source files that lacked them
Backfills the standard MIT X11 header on hand-written files that never
got one, attributing each to its first-commit author and year from git
history. Code vendored from dotnet/runtime and Humanizr/Humanizer gets
its origin's license lines and a provenance note instead. Generated
files (Resources.Designer.cs, the version-info template), tool-managed
suppression files, and BAML test-case fixtures intentionally stay
header-less.

Assisted-by: Claude:claude-fable-5:Claude Code
2026-07-05 21:09:46 +02:00

27 lines
776 B
C#

// Copyright (c) .NET Foundation and Contributors
//
// Vendored from Humanizr/Humanizer (https://github.com/Humanizr/Humanizer), MIT license.
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);
}