From 579e7b93c002ab07b261233c4e50fcd08248e43b Mon Sep 17 00:00:00 2001 From: XorogVEVO Date: Sun, 6 Feb 2022 10:59:19 +0100 Subject: [PATCH] Added GetHumanReadable for TimeSpan & FirstLetterToUpper --- UniversalExtensions.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/UniversalExtensions.cs b/UniversalExtensions.cs index 246c242..4a86b31 100644 --- a/UniversalExtensions.cs +++ b/UniversalExtensions.cs @@ -402,6 +402,15 @@ public static class UniversalExtensions public static string GetHumanReadable(this long seconds, TimeFormat timeFormat = TimeFormat.DAYS) => TimeSpan.FromSeconds(seconds).GetTimeFormat(timeFormat); + /// + /// + /// + /// + /// + /// + public static string GetHumanReadable(this TimeSpan timeSpan, TimeFormat timeFormat = TimeFormat.DAYS) => + timeSpan.GetTimeFormat(timeFormat); + /// @@ -489,4 +498,9 @@ public static class StringExt using SHA256 _SHA256 = SHA256.Create(); return BitConverter.ToString(_SHA256.ComputeHash(Encoding.ASCII.GetBytes(str))).Replace("-", "").ToLowerInvariant(); } + + public static string FirstLetterToUpper(this string str) + { + return $"{str.First().ToString().ToUpper()}{str.Remove(0, 1)}"; + } } \ No newline at end of file