How to find an element in a list without using the List library?

Asked

Viewed 32 times

0

Let’s say I have a list like that:

let A = ["Alunos", ["João", "Maria", "Paulo"], "Professores", ["Amélia", "Betina", "Carolina"]

How can I do a function that can find the word Students and return to the following list (in this case, ["John", "Mary", "Paul"])? Important! Not using the List library

  • 1

    use a `for to go through all the elements, compare the researched with each of the elements; if it is equal, you found it. (try!! if you have questions in the code you put the question ;])

  • but f# supports loops? I didn’t know that :(

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.