Search Results for

    Show / Hide Table of Contents

    Method EnvChar

    | Improve this Doc View Source

    EnvChar(String, Char)

    Gets the value of a variable in char format.

    Declaration
    char EnvChar(string variable, char defaultValue = '\0')
    Parameters
    Type Name Description
    String variable

    Environment variable name.

    Char defaultValue

    A default value in case the variable is not set.

    Returns
    Type Description
    Char

    A value of the environment variable in char format.

    Remarks

    If the environment variable is not set, the method will return the default value.

    Exceptions
    Type Condition
    ArgumentNullException

    variable is null.

    FormatException

    value is not in char format.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright ©2021 DotEnv.Core