@@ -161,13 +161,6 @@ ${'$'}_9.99
161
161
162
162
### Multi-dollar string interpolation
163
163
164
- > The multi-dollar string interpolation is [ Experimental] ( components-stability.md#stability-levels-explained )
165
- > and opt-in is required (see details below).
166
- >
167
- > It may be changed at any time. We would appreciate your feedback in [ YouTrack] ( https://youtrack.jetbrains.com/issue/KT-2425 ) .
168
- >
169
- {style="warning"}
170
-
171
164
Multi-dollar string interpolation allows you to specify how many consecutive dollar signs are required to trigger interpolation.
172
165
Interpolation is the process of embedding variables or expressions directly into a string.
173
166
@@ -186,7 +179,7 @@ val KClass<*>.jsonSchema : String
186
179
{
187
180
"$schema ": "https://json-schema.org/draft/2020-12/schema",
188
181
"$id ": "https://example.com/product.schema.json",
189
- "$dynamicAnchor ": "meta"
182
+ "$dynamicAnchor ": "meta",
190
183
"title": "$${simpleName ? : qualifiedName ? : " unknown" } ",
191
184
"type": "object"
192
185
}
@@ -222,24 +215,7 @@ println(requestedData)
222
215
223
216
Here, the ` $$$ ` prefix allows the string to include ` $ ` and ` $$ ` without requiring the ` ${'$'} ` construct for escaping.
224
217
225
- To enable the feature, use the following compiler option in the command line:
226
-
227
- ``` bash
228
- kotlinc -Xmulti-dollar-interpolation main.kt
229
- ```
230
-
231
- Alternatively, update the ` compilerOptions {} ` block of your Gradle build file:
232
-
233
- ``` kotlin
234
- // build.gradle.kts
235
- kotlin {
236
- compilerOptions {
237
- freeCompilerArgs.add(" -Xmulti-dollar-interpolation" )
238
- }
239
- }
240
- ```
241
-
242
- This feature doesn't affect existing code that uses single-dollar string interpolation.
218
+ Multi-dollar string interpolation doesn't affect existing code that uses single-dollar string interpolation.
243
219
You can continue using a single ` $ `
244
220
as before and apply multi-dollar signs when you need to handle literal dollar signs in strings.
245
221
0 commit comments