I have the following:
serv match {
case "chat" => Chat_Server ! Relay_Message(serv)
case _ => null
}
The problem is that sometimes I also pass an additional param on the end of the serv string, so:
var serv = "chat.message"
Is there a way I can match a part of the string so it still gets sent to Chat_Server?
Thanks for any help, much appreciated :)
serv
wants to be a more structured value and not just a simpleString
? – Disincentivecase class
would be perfect for this! – Smythenull
should be avoided in Scala; useOption
instead.null
really only exists for interoperability with Java. – Embolic