Social interactions with annotations (#4068)

Co-authored-by: Joe Milazzo <josephmajora@gmail.com>
This commit is contained in:
Fesaa
2025-10-04 22:11:06 +02:00
committed by GitHub
parent d4e3a2de3e
commit b40734265b
107 changed files with 7615 additions and 1402 deletions
+7 -2
View File
@@ -101,8 +101,7 @@ public static partial class StringExtensions
return [];
}
return value.Split(',')
.Where(s => !string.IsNullOrEmpty(s))
return value.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
.Select(int.Parse)
.ToList();
}
@@ -115,11 +114,17 @@ public static partial class StringExtensions
public static long ParseHumanReadableBytes(this string input)
{
if (string.IsNullOrWhiteSpace(input))
{
throw new ArgumentException("Input cannot be null or empty.", nameof(input));
}
var match = HumanReadableBytesRegex().Match(input);
if (!match.Success)
{
throw new FormatException($"Invalid format: '{input}'");
}
var value = double.Parse(match.Groups[1].Value, CultureInfo.InvariantCulture);
var unit = match.Groups[2].Value.ToUpperInvariant();