dotnet / dotnet/csharplang

Champion: verbatim interpolated string (order of $@ vs. @$) (16.3, Core 3)

Open
#1,630 47 comments 76 reactions 2 assignees Claimed by @jcouv View on GitHub
Implemented Needs ECMA Spec Proposal champion
Dominant language
C#
Stars
12.7k
Forks
1.1k
Avg merge
11h 1m
Merged PRs (30d)
3

Description

This proposal will extend object initializers to allow `@$"hello"` as a verbatim interpolated string, compared to `$@"hello"` (current interpolated verbatim string).

- [ ] Proposal added
- [x] Discussed in LDM (2018-7-9)
- [x] Decision in LDM (let's do it, 2018-7-9)
- [ ] Finalized (done, rejected, inactive)
- [ ] Spec'ed

LDM history:
- https://github.com/dotnet/csharplang/blob/master/meetings/2018/LDM-2018-07-09.md

----

Would it be possible for the order of the string interpolation and string literal identifiers to not matter?

e.g.

`var foo = $@"c:\foo\{someFile}";`

Is fine, but

`var foo = @$"c:\foo\{someFile}";`

isn't...

There's probably a good reason for it that I'm missing, but would it be possible to make the order not matter?

O/T And looking at the title, I now realise $@ v @$ looks a bit like some funky owl, which I'm pleased with.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.