Exemplo n.º 1
0
 private static object InternalCount(MutableString/*!*/ self, MutableString[]/*!*/ ranges) {
     BitArray map = new RangeParser(ranges).Parse();
     int count = 0;
     for (int i = 0; i < self.Length; i++) {
         if (map.Get(self.GetChar(i)))
             count++;
     }
     return ScriptingRuntimeHelpers.Int32ToObject(count);
 }
Exemplo n.º 2
0
 private static MutableString/*!*/ InternalDelete(MutableString/*!*/ self, MutableString[]/*!*/ ranges) {
     BitArray map = new RangeParser(ranges).Parse();
     MutableString result = self.CreateInstance().TaintBy(self);
     for (int i = 0; i < self.Length; i++) {
         if (!map.Get(self.GetChar(i))) {
             result.Append(self.GetChar(i));
         }
     }
     return result;
 }