GetUnitFromName

Length.GetUnitFromName method

Tries to parse specified unit name and return corresponding value of a Unit enum. Returns Unit.Unitless if cannot find appropriate unit.

public static Unit GetUnitFromName(string unitName)
Parameter Type Description
unitName String String, that represents a unit name

Return Value

Value of Unit enum in any case, Unit.Unitless when cannot find appropriate unit

See Also