A new feature in C# 11, released in 2022, is a raw string literal. Raw string literal is a new format for string literals that allows for whitespace, new lines, embedded quotes, other special characters, or whatever! This is a much better choice for multi-line strings over the original verbatim string literal.

7m read timeFrom freecodecamp.org
Post cover image
Table of contents
Quoted String LiteralVerbatim String LiteralRaw String Literal (new in C#11)String InterpolationNewlines in Interpolation Expressions (New in C# 11)Verbatim String InterpolationRaw String Interpolation (New in C# 11)Wrapping Up

Sort: