public static string Substring(this string s, IInterval i) { try { return(s.Substring(i.Start(), i.Length())); } catch (ArgumentOutOfRangeException e) { throw new ArgumentOutOfRangeException("Interval exceeding string dimensions.", e); } }