Exercise: Strings of colours

A String of favourite colours

Create a string containing the names and favourite colours of each person near you.

For example: "Our favourite colours are green and purple"

 
""
x
 
the evaluation will appear here (soon)...
Reveal answer...

Does the string contain your favorite colour

Use a function to see if a string contains a colour. See the Hint below if you are not sure how to start

For example, does the string "Rachel of York gave brown bread in vans" contain the colour brown?

 
()
 
the evaluation will appear here (soon)...
Reveal answer...

The clojure.stringclojure.string library

Remember that there are specific functions you can use in the clojure.string library

results matching ""

    No results matching ""