Back to Intellij Community

RedundantInterpolationPrefix

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/RedundantInterpolationPrefix.html

2025.3-rc-2538 B
Original Source

Reports redundant dollar prefixes in string template expressions.

Such prefixes can be safely removed.

Example:

fun example() {
    $"Example: prefix of length one is always redundant"
    $$"Example: string contains no interpolated values"
    $$"Example: $$ dollars are plain characters here $$"
}

After the quick fixes are applied:

fun example() {
    "Example: prefix of length one is always redundant"
    "Example: string contains no interpolated values"
    "Example: $$ dollars are plain characters here $$"
}