Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.75 KB

exercise-string-of-colours.md

File metadata and controls

47 lines (36 loc) · 1.75 KB

Exercise: Strings of colours

Note::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"

""
;; Just simply use a string
"We all love purple"

;; Using a function you can create a string and join values to create a string
(str "My favorite colours are" " " "green" " " "and" " ""purple")

Note::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?

()
(clojure.string/includes? "Rachel of York gave brown bread in vans" "brown")

####Hint::The clojure.stringclojure.string library Remember that there are specific functions you can use in the clojure.string library