Source/NFX/CodeAnalysis/CSharp/CSNumbers.cs
/// <summary>
///  Converts number string into int respectibg prefixes
/// </summary>
Converts number string into int respectibg prefixes
Converts number string into int respectibg prefixes
private static bool strToInt(string str, out ulong num)
    {
      if (UInt64.TryParse(str, out num))
        return true;
      try
      {
        if (str.StartsWith("0x"))   
        {
          num = System.Convert.ToUInt64(str.Substring(2), 16);
          return true;
        }
      }
      catch
      {
      }
      return false;
    }
private static bool strToInt ( string str , out ulong num ) { if ( UInt64 . TryParse ( str , out num ) ) return true ; try { if ( str . StartsWith ( " " ) ) { num = System . Convert . ToUInt64 ( str . Substring ( 2 ) , 16 ) ; return true ; } } catch { } return false ; }
Converts number string into int respectibg prefixes
Converts number string into int respectibg prefixes
//HEX //C# does not support BIN now, but nice to have //else if (str.StartsWith("0b")) //BIN //{ //  num = System.Convert.ToUInt64(str.Substring(2), 2); //  return true; //}
str
string
ulong
out