Method Parse
Parse(string)
Parses a human-readable size string (e.g., "10 KB", "2.5 MB") into a long representing the number of bytes.
public static long Parse(string humanReadableSize)
Parameters
humanReadableSize
stringThe human-readable size string to parse.
Returns
- long
The size in bytes, represented as a long.
Exceptions
- ArgumentNullException
Thrown if
humanReadableSize
is null or whitespace.- ArgumentException
Thrown if
humanReadableSize
is not in a valid format.