Exemple #1
0
 public Ar Filter(Func<dynamic, bool> method)
 {
     Ar newAr = new Ar();
     for (int i = this.Count - 1; i >= 0; i--)
     {
         if (method(this[i])) newAr.Push(this[i]);
     }
     return newAr;
 }
Exemple #2
0
 public Ar Map(Func<dynamic, int, dynamic> method)
 {
     Ar newAr = new Ar();
     for (int i = 0; i < this.Count; i++)
     {
         newAr.Push(method(this.Get(i), i));
     }
     return newAr;
 }
Exemple #3
0
 public Ar Slice(int start, int end)
 {
     Ar newAr = new Ar();
     if (start < 0) start = this.Count - start;
     if (end < 0) end = this.Count - end;
     for (int i = start; i < end; i++)
     {
         newAr.Push(this[i]);
     }
     return newAr;
 }
Exemple #4
0
 public Ar Map(Func<dynamic, dynamic> method)
 {
     Ar newAr = new Ar();
     foreach (dynamic item in this)
     {
         newAr.Push(method(item));
     }
     return newAr;
 }