fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 135: Remove item from list, by its value
Idiom # 135: Remove item from list, by its value
See
programming-idioms.org
:
Code
match items.index_of x i i32 => items.take i ++ items.drop i+1 nil => items
What are effects?
Running Example
ex135 is items := ["a","b","c","b","c","a"].as_list x := "b" items1 := match items.index_of x i i32 => items.take i ++ items.drop i+1 nil => items say items1
What are effects?
last changed: 2024-07-01
next: Idiom # 136: Remove all occurrences of a value from a list