Skip to content

Instantly share code, notes, and snippets.

@dcampogiani
Created August 15, 2020 10:41
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 dcampogiani/da5ea7ce965c3d9d94fd22326ec34534 to your computer and use it in GitHub Desktop.
Save dcampogiani/da5ea7ce965c3d9d94fd22326ec34534 to your computer and use it in GitHub Desktop.
private fun extractNumber(lines: List<String>): String? {
return lines.firstOrNull { line ->
val subNumbers = line.split(" ")
subNumbers.isNotEmpty() && subNumbers.flatMap { it.asIterable() }.all { it.isDigit() }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment