Created
December 29, 2020 08:23
-
-
Save KardanovIR/a24d29ab4d5d2eaa065d1620e53bc8e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func findString(a: Any) = { | |
match a { | |
case a: String => a | |
case a: List[Any] => | |
match a[0] { | |
case b: String => b | |
case _ => throw("Data is not a string") | |
} | |
case _ => throw("Data is not a string") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment