Last active
September 4, 2020 18:59
-
-
Save windmaomao/5a78e9dc5ff71c99ad5b7a89c479a14f 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
fun String.extractNumbers(): List<Int> = | |
"""\d+""".toRegex() | |
.findAll(this) | |
.map { it.value.toInt() } | |
.toList() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment