RosettaCodeData/Task/Search-a-list/F-Sharp/search-a-list.fs
2023-07-01 13:44:08 -04:00

4 lines
323 B
GLSL

List.findIndex (fun x -> x = "bar") ["foo"; "bar"; "baz"; "bar"] // -> 1
// A System.Collections.Generic.KeyNotFoundException
// is raised, if the predicate does not evaluate to
// true for any list element.