|
Il presente articolo è stato tradotto automaticamente. Passare il puntatore sulle frasi nell'articolo per visualizzare il testo originale. Ulteriori informazioni.
|
Traduzione
Originale
|
Funzione List.filter<'T> (F#)
Visual Studio 2012
// Signature:
List.filter : ('T -> bool) -> 'T list -> 'T list
// Usage:
List.filter predicate list
let evenOnlyList = List.filter (fun x -> x % 2 = 0) [1; 2; 3; 4; 5; 6]
let data = [("Cats",4); ("Dogs",5); ("Mice",3); ("Elephants",2)] let res = data |> List.filter (fun (nm,x) -> nm.Length <= 4) printfn "Animals with short names: %A" res
Animali con nomi brevi: [("Cats", 4); ("Dogs", 5); ("Mice", 3)]