C#@""如何插入一个标签? [英] C# @"" how do i insert a tab?

查看:169
本文介绍了C#@""如何插入一个标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我发现我可以在写两个前 @ABC,高清。我觉得@字符串是有用的。但我怎么在选项卡或换行写?为唯一的伎俩可用?我试着搜索 MSDN 但我不能找到它。

Recently i found out i can write in a " by writing two " ex @"abc""def". I find the @ string literal useful. But how do i write in a tab or newline? is "" the only trick available? I tried search msdn but i couldnt find it.

推荐答案

当您使用 @ 修改器,你正在使用一种叫做的逐字字符串。

When you are using the @ modifier, you are using something called a verbatim string literal.

这意味着你把在开幕之间的任何对引号将字符串中使用。

What this means is that anything you put in between the Opening and closing quotes will be used in the string.

这包括Carraige符,换行符,标签等

This includes Carraige Return, Line Feed, Tab and etc.

简短的回答:按一下Tab

Short answer: Just press tab.

有一点需要注意,虽然。您的IDE可以决定插入空格代替制表符,所以你可以使用串联会更好。

One caveat, though. Your IDE may decide to insert spaces instead of a tab character, so you may be better off using concatenation.

这篇关于C#@""如何插入一个标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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