public static string getRange(string self, Range r) { int size = self.Length; int s = r.start(size); int e = r.end(size); if (e+1 < s) throw IndexErr.make(r).val; return self.Substring(s, (e-s)+1); }