dotnet / dotnet/vblang

Add Backtick String Literals to VB.NET

Open
#634 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

## 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:

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

Proposed Clean Syntax:

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

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.