# Parse

> Parses an int from this string starting at a byte offset.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## Parse\<T>(T, int, int)

Parses an int from this string starting at a byte offset.

```csharp
public static ParseError Parse<T>(this ref T fs, ref int offset, ref int output) where T : unmanaged, INativeList<byte>, IUTF8Bytes
```

### Parameters

**** (T): The string from which to parse.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A reference to an index of the byte at which to parse an int.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Outputs the parsed int. Ignore if parsing fails.

### Returns

| Type                                                                          | Description                                                                                |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [ParseError](/engine/6000.7/script-reference/unity/collections/parseerror.md) | 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.

```csharp
public static ParseError Parse<T>(this ref T fs, ref int offset, ref uint output) where T : unmanaged, INativeList<byte>, IUTF8Bytes
```

### Parameters

**** (T): The string from which to parse.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A reference to an index of the byte at which to parse a uint.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): Outputs the parsed uint. Ignore if parsing fails.

### Returns

| Type                                                                          | Description                                                                                |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [ParseError](/engine/6000.7/script-reference/unity/collections/parseerror.md) | 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.

```csharp
public static ParseError Parse<T>(this ref T fs, ref int offset, ref float output, char decimalSeparator = '.') where T : unmanaged, INativeList<byte>, IUTF8Bytes
```

### Parameters

**** (T): The string from which to parse.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the byte at which to parse a float.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Outputs the parsed float. Ignore if parsing fails.**** (\[char]\(https\://learn.microsoft.com/dotnet/api/system.char)): The character used to separate the integer part of the number from the fractional part. Defaults to '.' (period).

### Returns

| Type                                                                          | Description                                                                                                       |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| [ParseError](/engine/6000.7/script-reference/unity/collections/parseerror.md) | 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.
