Files
openide/plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/ReplaceStringFormatWithLiteral.html
Ilya Kirillov 3386f8f5a9 [kotlin] move inspection descriptions to separate module to reuse in K2
GitOrigin-RevId: e9d7382f4d640e27b1958d1bf2d4c3e639915137
2022-07-13 09:59:31 +00:00

24 lines
641 B
HTML

<html>
<body>
Reports <code>String.format</code> calls that can be replaced with string templates.
<p>Using string templates makes your code simpler.</p>
<p>The quick-fix replaces the call with a string template.</p>
<p><b>Example:</b></p>
<pre><code>
fun main() {
val id = &quot;abc&quot;
val date = &quot;123&quot;
val s = String.format(&quot;%s_%s_%s&quot;, id, date, id)
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
fun main() {
val id = &quot;abc&quot;
val date = &quot;123&quot;
val s = &quot;${id}_${date}_$id&quot;
}
</code></pre>
<!-- tooltip end -->
</body>
</html>