About 33,600,000 results
Open links in new tab
  1. Multiline string literal in C# - Stack Overflow

    You can use the @ symbol in front of a string to form a verbatim string literal: string query = @"SELECT foo, bar FROM table WHERE id = 42"; You also do not have to escape special …

  2. Can I "multiply" a string (in C#)? - Stack Overflow

    Unfortunately / fortunately, the string class is sealed so you can't inherit from it and overload the * operator. You can create an extension method though: StringBuilder sb = new …

  3. Replace Multiple String Elements in C# - Stack Overflow

    Aug 24, 2009 · Just use a List<Tuple<string,string>>. This also changes the order of the replacings is taken AND is not as fast as e.g. s.Replace("a").Replace("b").Replace("c").

  4. How to concatenate multiple strings - C# | Microsoft Learn

    To concatenate string variables, you can use the + or += operators, string interpolation or the String.Format, String.Concat, String.Join or StringBuilder.Append methods.

  5. Using Multiline String Literals in C#: Methods and Examples

    Learn how to create and use multiline string literals in C# with examples using verbatim strings (@) and string interpolation.

  6. Mastering Raw String Literals for Clean Multi-Line Code in C# 11

    When C# 11 introduced raw string literals, it quietly solved one of the most awkward and long-standing challenges in .NET programming—handling multi-line strings, especially those that …

  7. Mastering Multiline Strings in C# - Web Dev Tutor

    Jul 24, 2024 · In C#, there are several ways to handle multiline strings, each with its own advantages and use cases. Using the verbatim string literal '@' symbol allows you to define …

  8. How to create Multiline String in CSharp examples | C# Examples

    Dec 31, 2023 · Multiple ways to create a multi-line string in C# with raw string syntax and verbatim string syntax with interpolated variables

  9. Understanding and Working with Multiline Strings in C# - Gyata

    Dec 8, 2023 · Defining a Multiline String in C# is as simple as adding an @ symbol before your string. Here's an example: multiline string in C#."; In the above code snippet, the Multiline …

  10. All About Multiline Strings in C# | by Dev Leader | Dev Leader

    Feb 12, 2023 · Our next example is perhaps the most simple way to multiline a string. However, it is important to note that this example looks at creating a multiline string where the resulting …

Refresh