Skip to content

Add Backtick String Literals to VB.NET #634

@benyuz

Description

@benyuz

Proposal: Add Backtick String Literals to VB.NET

# 建议为VB.NET添加反引号字符串字面量

Body:

1. The Core Problem:

VB.NET's current requirement to escape double quotes (
"""") within strings significantly reduces code readability and writing efficiency, especially when working with text containing many quotes (e.g., SQL, JSON).

2. Proposed Solution:

Introduce the backtick (
" ` ") as an additional string delimiter. Backtick-string literals would:

  • Support multi-line strings without needing line continuation characters.
  • Allow unescaped double quotes within the string content.

3. Key Benefits:

  • Cleaner Code: Greatly improves readability for embedded code (e.g., SQL, JSON).
  • More Efficient Development: Reduces escaping errors and simplifies string concatenation.
  • Modern Alignment: Brings VB.NET in line with modern languages like C# and JavaScript, enhancing its appeal.

Code Example:

Current Verbose Syntax:

Dim sql = "SELECT * FROM table WHERE name = ""Test"""

Proposed Clean Syntax:

Dim sql = `SELECT * FROM table WHERE name = "Test"`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions