https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
h

Harsh Joshi

03/13/2023, 11:55 AM
Hey I am not able to use String.format in Shared module that is powered by KMM. Does anyone has any clue?
v

Vidmantas Kerbelis

03/13/2023, 12:07 PM
String.format() comes from Java:
Copy code
java.lang.String.format(locale, format, *args)
You can’t use that in Kotlin.
Well you can use it in Kotlin as long as it's targeting the JVM only
v

Vidmantas Kerbelis

03/13/2023, 12:08 PM
Yes, true. I assume you don’t just use JVM
e

ephemient

03/13/2023, 12:09 PM
https://youtrack.jetbrains.com/issue/KT-25506 it has been requested, but String.format is pretty huge and complex, and you probably don't need all of it. what do you actually want to achieve?
114 Views