Class Address | Localization | 0.6.1-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class Address

    Generic class that can be used for United States addresses

    Inheritance
    Object
    Address
    Namespace: UnityEngine.Localization.SmartFormat.Tests
    Syntax
    public class Address

    Constructors

    Address(String, String, String, String)

    Declaration
    public Address(string NewStreetAddress, string NewCity, string NewState, string NewZip)
    Parameters
    Type Name Description
    String NewStreetAddress
    String NewCity
    String NewState
    String NewZip

    Address(String, String, States, String)

    Declaration
    public Address(string NewStreetAddress, string NewCity, States NewState, string NewZip)
    Parameters
    Type Name Description
    String NewStreetAddress
    String NewCity
    States NewState
    String NewZip

    Properties

    City

    Declaration
    public string City { get; set; }
    Property Value
    Type Description
    String

    FullAddress

    Returns the full, formatted address on two lines.

    Declaration
    public string FullAddress { get; }
    Property Value
    Type Description
    String

    State

    Declaration
    public States State { get; set; }
    Property Value
    Type Description
    States

    StateAbbreviation

    Returns the 2-letter abbreviation of the state. For example, States.California = "CA"

    Declaration
    public string StateAbbreviation { get; }
    Property Value
    Type Description
    String

    StreetAddress

    Declaration
    public string StreetAddress { get; set; }
    Property Value
    Type Description
    String

    Zip

    Declaration
    public string Zip { get; set; }
    Property Value
    Type Description
    String

    Methods

    GetStateAbbreviation(States)

    Declaration
    public static string GetStateAbbreviation(States state)
    Parameters
    Type Name Description
    States state
    Returns
    Type Description
    String

    Parse(String)

    Declaration
    public static Address Parse(string AddressString)
    Parameters
    Type Name Description
    String AddressString
    Returns
    Type Description
    Address

    ParseState(String)

    Declaration
    public static States ParseState(string state)
    Parameters
    Type Name Description
    String state
    Returns
    Type Description
    States

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()

    TryParse(String, ref Address)

    Parses the AddressString to determine the Street Address, City, State, and Zip. Addresses are expected to be in 2-line style, or in single-line style with a comma between the address and city.

    Throws an exception if the address cannot be properly parsed!

    Declaration
    public static bool TryParse(string AddressString, ref Address result)
    Parameters
    Type Name Description
    String AddressString

    The entire Address.

    Address result
    Returns
    Type Description
    Boolean
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023