Is there a String.format to interpolation codemod?

I recently wrote a lot of Java code that was littered with String.format calls. I converted it all to Kotlin, but I’m wondering if there’s an easy and automated way to convert all the instances of String.format to Kotlin-native string interpolation.

For example, String.format("Hello, %s!", name) should become "Hello, ${name}!.

Thanks!

1 Like

IDEA Java to Kotlin converter should be able to do that, please add concrete use cases to https://youtrack.jetbrains.com/issue/KT-8946

1 Like