I will remove the semicolon and make it two lines. Otherwise, this is an absolutely wonderful functional code.
:
def pair(s:String) =
s.split(":") match {
case Array(a, b) => Some(a, b)
case _ => None
}
, , , if-else - , . , . , a(0), .
- , . , a(0) , . if, , , . .
, if-else. , . , .