Parse
Parses an int from this string starting at a byte offset.
Read time 2 minutesLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
Parse<T>(T, int, int)
Parses an int from this string starting at a byte offset.
public static ParseError Parse<T>(this ref T fs, ref int offset, ref int output) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| ParseError | ParseError.None if successful. Otherwise returns ParseError.Overflow or ParseError.Syntax. |
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>(T, int, uint)
Parses an uint from this string starting at a byte offset.
public static ParseError Parse<T>(this ref T fs, ref int offset, ref uint output) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| ParseError | ParseError.None if successful. Otherwise returns ParseError.Overflow or ParseError.Syntax. |
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>(T, int, float, char)
Parses a float from this string starting at a byte offset.
public static ParseError Parse<T>(this ref T fs, ref int offset, ref float output, char decimalSeparator = '.') where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| ParseError | ParseError.None if successful. Otherwise returns ParseError.Overflow, ParseError.Underflow, or ParseError.Syntax. |
Remarks
The parsed value is bitwise-identical to the result of System.Single.Parse.