Skip to content

Commit 3154655

Browse files
CopilotBillWagner
andcommitted
Document ToString() conversion for F# interpolated strings
Co-authored-by: BillWagner <[email protected]>
1 parent b8e51db commit 3154655

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/fsharp/language-reference/interpolated-strings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ printfn $"I think {3.0 + 0.14} is close to {System.Math.PI}!"
3333

3434
The contents in between each `{}` brace pair can be any F# expression.
3535

36+
For non-typed interpolated strings (without format specifiers), the expression is converted to a string using the `ToString()` method. If the expression evaluates to `null`, an empty string is used. For typed interpolated strings with format specifiers (such as `%s{expr}` or `%d{expr}`), the conversion follows the rules defined for that specific format specifier.
37+
3638
To escape a `{}` brace pair, write two of them like so:
3739

3840
```fsharp

0 commit comments

Comments
 (0)