I have an Option[String] and I want to make sure that the string is lower case. What is the idiomatic way to 'reach into' the Option and make the transformation without having to extract the string and then put it back into an Option?
Thanks
I have an Option[String] and I want to make sure that the string is lower case. What is the idiomatic way to 'reach into' the Option and make the transformation without having to extract the string and then put it back into an Option?
Thanks
val x : Option[String] = Some("Hello")
x map (_.toLowerCase)
res2: Option[String] = Some(hello)