guys guys guys I have a string with some text and ...
# getting-started
e
guys guys guys I have a string with some text and numbers. And I want to retrieve all numbers from that string via collection’s extension function. How can I do that? I saw documentation, but there are sooo many ext. functions...
Copy code
val listOfNumbers = "text 123 and more text 456".someKindOfMap { Regex("\\d+") }
a
evkaky: If you just want all the numbers. You can do
list.filter { it.isDigit() }