public static bool TryParse(
string? s,
IFormatProvider? provider,
out BinarySize? result
)
Public Shared Function TryParse (
s As String,
provider As IFormatProvider,
<OutAttribute> ByRef result As BinarySize
) As Boolean
public:
static bool TryParse(
String^ s,
IFormatProvider^ provider,
[OutAttribute] BinarySize% result
)
static member TryParse :
s : string *
provider : IFormatProvider *
result : BinarySize byref -> bool
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 TryParse(String, BinarySizeOptions, NumberStyles, IFormatProvider, BinarySize) method.