Skip to content

Commit f718767

Browse files
authored
Merge pull request #3147 from Flowdalic/string-interpolators
string-interpolation: fix headline level
2 parents 0f0ade0 + 9186862 commit f718767

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_overviews/scala3-book/string-interpolation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ println(s"$name is $age years old") // "James is 30 years old"
2828
Using string interpolation consists of putting an `s` in front of your string
2929
quotes, and prefixing any variable names with a `$` symbol.
3030

31-
### Other interpolators
31+
## String Interpolators
3232

3333
The `s` that you place before the string is just one possible interpolator that Scala
3434
provides.
@@ -38,7 +38,7 @@ Further, a string interpolator is just a special method, so it is possible to de
3838
own. For instance, some database libraries define a `sql` interpolator that returns a
3939
database query.
4040

41-
## The `s` Interpolator (`s`-Strings)
41+
### The `s` Interpolator (`s`-Strings)
4242

4343
Prepending `s` to any string literal allows the usage of variables directly in the string. You've already seen an example here:
4444

@@ -121,7 +121,7 @@ age: 30
121121
{% endtab %}
122122
{% endtabs %}
123123

124-
## The `f` Interpolator (`f`-Strings)
124+
### The `f` Interpolator (`f`-Strings)
125125

126126
Prepending `f` to any string literal allows the creation of simple formatted strings, similar to `printf` in other languages. When using the `f`
127127
interpolator, all variable references should be followed by a `printf`-style format string, like `%d`. Let's look at an example:

0 commit comments

Comments
 (0)