Method Parse
Parse<T>(ref T, ref int, ref int)
Parses an int from this string starting at a byte offset.
Declaration
public static ParseError Parse<T>(this ref T fs, ref int offset, ref int output) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | fs | The string from which to parse. |
int | offset | A reference to an index of the byte at which to parse an int. |
int | output | Outputs the parsed int. Ignore if parsing fails. |
Returns
Type | Description |
---|---|
Parse |
ParseError.None if successful. Otherwise returns ParseError.Overflow or ParseError.Syntax. |
Type Parameters
Name | Description |
---|---|
T | A FixedStringNBytes type. |
Remarks
Stops parsing after the last number character. (Unlike parsing methods in other API's, this method does not expect to necessarily parse the entire string.)
The parsed value is bitwise-identical to the result of System.Int32.Parse.
Parse<T>(ref T, ref int, ref uint)
Parses an uint from this string starting at a byte offset.
Declaration
public static ParseError Parse<T>(this ref T fs, ref int offset, ref uint output) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | fs | The string from which to parse. |
int | offset | A reference to an index of the byte at which to parse a uint. |
uint | output | Outputs the parsed uint. Ignore if parsing fails. |
Returns
Type | Description |
---|---|
Parse |
ParseError.None if successful. Otherwise returns ParseError.Overflow or ParseError.Syntax. |
Type Parameters
Name | Description |
---|---|
T | A FixedStringNBytes type. |
Remarks
Stops parsing after the last number character. (Unlike parsing methods in other API's, this method does not expect to necessarily parse the entire string.)
The parsed value is bitwise-identical to the result of System.UInt32.Parse.
Parse<T>(ref T, ref int, ref float, char)
Parses a float from this string starting at a byte offset.
Declaration
public static ParseError Parse<T>(this ref T fs, ref int offset, ref float output, char decimalSeparator = '.') where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | fs | The string from which to parse. |
int | offset | Index of the byte at which to parse a float. |
float | output | Outputs the parsed float. Ignore if parsing fails. |
char | decimalSeparator | The character used to separate the integer part of the number from the fractional part. Defaults to '.' (period). |
Returns
Type | Description |
---|---|
Parse |
ParseError.None if successful. Otherwise returns ParseError.Overflow, ParseError.Underflow, or ParseError.Syntax. |
Type Parameters
Name | Description |
---|---|
T | A FixedStringNBytes type. |
Remarks
The parsed value is bitwise-identical to the result of System.Single.Parse.