Fan.Sys.Range.fromStr C# (CSharp) Method

fromStr() public static method

public static fromStr ( string s, bool check ) : Range
s string
check bool
return Range
        public static Range fromStr(string s, bool check)
        {
            try
              {
            int dot = s.IndexOf('.');
            if (s[dot+1] != '.') throw new Exception();
            bool exclusive = s[dot+2] == '<';
            long start = Convert.ToInt64(s.Substring(0, dot));
            long end   = Convert.ToInt64(s.Substring(dot + (exclusive?3:2)));
            return new Range(start, end, exclusive);
              }
              catch (Exception) {}
              if (!check) return null;
              throw ParseErr.make("Range", s).val;
        }

Same methods

Range::fromStr ( string s ) : Range