Skip to content

Instantly share code, notes, and snippets.

@KardanovIR
Created December 29, 2020 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KardanovIR/a24d29ab4d5d2eaa065d1620e53bc8e2 to your computer and use it in GitHub Desktop.
Save KardanovIR/a24d29ab4d5d2eaa065d1620e53bc8e2 to your computer and use it in GitHub Desktop.
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