H3Lib/Api.cs
/// <summary>
/// converts the canonical string format to H3Index format
/// </summary>
converts the canonical string format to H3Index format
converts the canonical string format to H3Index format
public static H3Index StringToH3(string s)
        {
            if (s.StartsWith("0x") || s.StartsWith("0X"))
            {
                s = s.Substring(2);
            }
            if (s.StartsWith("x") || s.StartsWith("X"))
            {
                s = s.Substring(1);
            }
            return ulong.TryParse(s, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong h3)
                       ? new H3Index(h3)
                       : new H3Index(Constants.H3Index.H3_NULL);
        }
public static H3Index StringToH3 ( string s ) { if ( s . StartsWith ( " " ) || s . StartsWith ( " " ) ) { s = s . Substring ( 2 ) ; } if ( s . StartsWith ( " " ) || s . StartsWith ( " " ) ) { s = s . Substring ( 1 ) ; } return ulong . TryParse ( s , NumberStyles . HexNumber , CultureInfo . InvariantCulture , out ulong h3 ) ? new H3Index ( h3 ) : new H3Index ( Constants . H3Index . H3_NULL ) ; }
converts the canonical string format to H3Index format
converts the canonical string format to H3Index format
s
string