SyntaxFix
Write A Post
Hire A Developer
Questions
Kotlin
val number = 088899998888 val phone = number.phoneFormatter() fun String.phoneFormatter(): String { return this.replace("\\B(?=(\\d{4})+(?!\\d))".toRegex(), "-") }
The result will be 0888-9999-8888
0888-9999-8888