Files
pgsql-jellyfin/MediaBrowser.Model/Extensions/StringHelper.cs
wjones af1152b001 Refactor: standardize namespace and using directive style
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
2026-02-20 16:26:53 -05:00

41 lines
1.2 KiB
C#

// <copyright file="StringHelper.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace MediaBrowser.Model.Extensions;
using global::System;
/// <summary>
/// Helper methods for manipulating strings.
/// </summary>
public static class StringHelper
{
/// <summary>
/// Returns the string with the first character as uppercase.
/// </summary>
/// <param name="str">The input string.</param>
/// <returns>The string with the first character as uppercase.</returns>
public static string FirstToUpper(string str)
{
if (str.Length == 0)
{
return str;
}
// We check IsLower instead of IsUpper because both return false for non-letters
if (!char.IsLower(str[0]))
{
return str;
}
return string.Create(
str.Length,
str.AsSpan(),
(chars, buf) =>
{
chars[0] = char.ToUpperInvariant(buf[0]);
buf.Slice(1).CopyTo(chars.Slice(1));
});
}
}