Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

FixedStringMethods.Parse

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static ParseError Parse(ref T fs, ref int offset, ref int output);

Parameters

Parameter Description
fs The string from which to parse.
offset A reference to an index of the byte at which to parse an int.
output Outputs the parsed int. Ignore if parsing fails.

Returns

ParseError ParseError.None if successful. Otherwise returns ParseError.Overflow or ParseError.Syntax.

Description

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

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.


Declaration

public static ParseError Parse(ref T fs, ref int offset, ref uint output);

Parameters

Parameter Description
fs The string from which to parse.
offset A reference to an index of the byte at which to parse a uint.
output Outputs the parsed uint. Ignore if parsing fails.

Returns

ParseError ParseError.None if successful. Otherwise returns ParseError.Overflow or ParseError.Syntax.

Description

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

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.


Declaration

public static ParseError Parse(ref T fs, ref int offset, ref float output, char decimalSeparator);

Parameters

Parameter Description
fs The string from which to parse.
offset Index of the byte at which to parse a float.
output Outputs the parsed float. Ignore if parsing fails.
decimalSeparator The character used to separate the integer part of the number from the fractional part. Defaults to '.' (period).

Returns

ParseError ParseError.None if successful. Otherwise returns ParseError.Overflow, ParseError.Underflow, or ParseError.Syntax.

Description

Parses a float from this string starting at a byte offset.

The parsed value is bitwise-identical to the result of System.Single.Parse.