public static BinarySize Parse(
string s,
IFormatProvider? provider
)
Public Shared Function Parse (
s As String,
provider As IFormatProvider
) As BinarySize
public:
static BinarySize Parse(
String^ s,
IFormatProvider^ provider
)
static member Parse :
s : string *
provider : IFormatProvider -> BinarySize
The input must contain a number, followed by one of the following units: "B", "KB", "KiB", "MB", "MiB", "GB", "GiB", "TB", "TiB", "PB", "PiB", "EB", or "EiB". The "B" may be omitted, and the casing of the unit and any surrounding whitespace is ignored.
This method uses the definition that "1 KB" == 1024 bytes, identical to "1 KiB", and "1 MB" == "1 MiB" == 1048576 bytes, and so on. To use the IEC standard where SI prefixes are treated as powers of ten, use the Parse(String, BinarySizeOptions, NumberStyles, IFormatProvider) method.
ArgumentNullException | s is . |
ArgumentException | options is not valid. |
FormatException | s is not in the correct format. |
OverflowException | s is not representable as a BinarySize. |