lets=[1;2;3];[4;5;6];[7;8;9];
What should I do if I want a list of int lists with specific values?
ocaml
You can use the filter
function to extract only the elements that meet the conditions of the functions in List
module and the exists
function to see if there is at least one element that meets the condition:
(Example of looking for a list containing *5)
# List.(filter(funx->exists(funx->x=5)l)ls);;
© 2024 OneMinuteCode. All rights reserved.