Sisk

Method

SizeHelper.Parse

Namespace
Sisk.Core.Helpers
Assembly
Sisk.Core.dll

Parse(string) #

Parses a human-readable size string (e.g., “10 KB”, “2.5 MB”) into a long representing the number of bytes.

C#
public static long Parse(string humanReadableSize)

Parameters #

humanReadableSize string

The 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.

Type to search the documentation and the API reference.