{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method Parse | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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
    ParseError

    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
    ParseError

    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
    ParseError

    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.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)