Fixed: Add Tests for FirstCharTo

This commit is contained in:
Mark McDowall
2019-06-29 15:33:49 -07:00
committed by Qstick
parent 4af18f7d4a
commit f868e8b964
6 changed files with 122 additions and 2 deletions

View File

@@ -24,12 +24,22 @@ namespace NzbDrone.Common.Extensions
public static string FirstCharToLower(this string input)
{
return input.First().ToString().ToLower() + input.Substring(1);
if (string.IsNullOrEmpty(input))
{
return string.Empty;
}
return char.ToLowerInvariant(input.First()) + input.Substring(1);
}
public static string FirstCharToUpper(this string input)
{
return input.First().ToString().ToUpper() + input.Substring(1);
if (string.IsNullOrEmpty(input))
{
return string.Empty;
}
return char.ToUpperInvariant(input.First()) + input.Substring(1);
}
public static string Inject(this string format, params object[] formattingArgs)