Show / Hide Table of Contents

    Struct SByte

    Represents an 8-bit signed integer.

    Inherited Members
    ValueType.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Namespace: System
    Assembly: mscorlib.dll
    Syntax
    [CLSCompliant(false)]
    public struct SByte

    Fields

    | Improve this Doc View Source

    MaxValue

    Represents the largest possible value of SByte. This field is constant.

    Declaration
    public const sbyte MaxValue = 127
    Field Value
    Type Description
    SByte
    Remarks

    The value of this constant is 127; that is, hexadecimal 0x7F.

    | Improve this Doc View Source

    MinValue

    Represents the smallest possible value of SByte. This field is constant.

    Declaration
    public const sbyte MinValue = -128
    Field Value
    Type Description
    SByte
    Remarks

    The value of this constant is -128; that is, hexadecimal 0x80.

    Methods

    | Improve this Doc View Source

    Parse(String)

    Converts the string representation of a number to its 8-bit signed integer equivalent.

    Declaration
    [CLSCompliant(false)]
    public static sbyte Parse(string s)
    Parameters
    Type Name Description
    String s

    A string that represents a number to convert. The string is interpreted using the NumberStyles.Integer style.

    Returns
    Type Description
    SByte

    An 8-bit signed integer that is equivalent to the number contained in the s parameter.

    Exceptions
    Type Condition
    ArgumentNullException

    s is null.

    | Improve this Doc View Source

    ToString()

    Converts the numeric value of this instance to its equivalent string representation.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    The string representation of the value of this instance, consisting of a negative sign if the value is negative, and a sequence of digits ranging from 0 to 9 with no leading zeroes.

    Overrides
    Object.ToString()
    | Improve this Doc View Source

    ToString(String)

    Converts the numeric value of this instance to its equivalent string representation, using the specified format.

    Declaration
    public string ToString(string format)
    Parameters
    Type Name Description
    String format

    A standard or custom numeric format string.

    Returns
    Type Description
    String

    The string representation of the value of this instance as specified by format.

    | Improve this Doc View Source

    TryParse(String, out SByte)

    Tries to convert the string representation of a number to its SByte equivalent, and returns a value that indicates whether the conversion succeeded.

    Declaration
    [CLSCompliant(false)]
    public static bool TryParse(string s, out sbyte result)
    Parameters
    Type Name Description
    String s

    A string that contains a number to convert.

    SByte result

    When this method returns, contains the 8-bit signed integer value that is equivalent to the number contained in s if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or Empty, is not in the correct format, or represents a number that is less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

    Returns
    Type Description
    Boolean

    true if s was converted successfully; otherwise, false.

    Remarks

    The TryParse(String, out SByte)(String, SByte) method is like the Parse(String)(String) method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a FormatException if value is invalid and cannot be successfully parsed.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX