什么是`@`意味着在C#中的字符串的开始? [英] What does `@` mean at the start of a string in C#?

查看:131
本文介绍了什么是`@`意味着在C#中的字符串的开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑以下行:

 只读私人字符串TARGET_BTN_IMG_URL = @\\ad1-sunglim\Test\\ \\; 

在这一行,为什么@需要连接?


< DIV CLASS =h2_lin>解决方案

它是指一个字符串,其中'\'字不表示一个转义序列。


Consider the following line:

readonly private string TARGET_BTN_IMG_URL = @"\\ad1-sunglim\Test\";

In this line, why does @ need to be attached?

解决方案

It denotes a literal string, in which the '\' character does not indicate an escape sequence.

这篇关于什么是`@`意味着在C#中的字符串的开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆