Vyxapedia

Element - - Slice Until

Characters:


Description

Slice a list until a certain index / find all results for a regex match


Overloads

  • any-num - a[0:b] (slice until b)
  • num-any - b[0:a] (slice until a)
  • str-str - regex.findall(pattern=a,string=b) (find all matches for a regex)
  • any-fun - take results from a while b(x) is truthy
  • fun-any - take results from b while a(x) is truthy

Examples

  • `abc` 1 Ẏ = `a`
  • ⟨1|2|3⟩ 2 Ẏ = ⟨1|2⟩
  • 123 2 Ẏ = 12
  • `abc` `.` Ẏ = ⟨`a`|`b`|`c`⟩
  • `abc` `d` Ẏ = ⟨⟩
  • `abc` 9 Ẏ = `abcabcabc`