Skip to content

Commit f98a1d6

Browse files
CopilotBillWagnerCopilot
authored
Document ToString() conversion for F# interpolated strings (#49134)
* Initial plan * Document ToString() conversion for F# interpolated strings Co-authored-by: BillWagner <[email protected]> * Add ai-usage frontmatter to indicate AI assistance Co-authored-by: BillWagner <[email protected]> * Update docs/fsharp/language-reference/interpolated-strings.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: BillWagner <[email protected]> Co-authored-by: Bill Wagner <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent a948e98 commit f98a1d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Interpolated strings
33
description: Learn about interpolated strings, a special form of string that allows you to embed F# expressions directly inside them.
44
ms.date: 10/01/2025
5+
ai-usage: ai-assisted
56
---
67

78
# Interpolated strings
@@ -33,6 +34,9 @@ printfn $"I think {3.0 + 0.14} is close to {System.Math.PI}!"
3334

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

37+
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.
38+
39+
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.
3640
To escape a `{}` brace pair, write two of them like so:
3741

3842
```fsharp

0 commit comments

Comments
 (0)