Reputation: 41
please help. re: ...an Option[List[String]] that contains a list of Play's I18n lang codes, , e.g. ['es', 'en']......
I have no idea how to parse the Option[List[String]]...
Once in the format of a Option[List[String]], how do i write scala code to say, given a language code of 'es', how do I see if the Option[List[String]] contains 'es'?
Upvotes: 0
Views: 53
Reputation: 1066
You can get rid of the Option
by using getOrElse
. Then you can call contains
on the List
.
optListString.getOrElse(List.empty).contains("es")
Upvotes: 2