"Posts: 1241".match(/\d+/)[0] // result: 1241
What is the shortest way to do this in Kotlin (JVM)
"Posts: 1241".match(/\d+/)[0] // result: 1241
What is the shortest way to do this in Kotlin (JVM)
I figured out by myself, hope it will help someone in future:
Regex("(\\d+)").find(str)?.value