gpt4 book ai didi

c# - 如何在 C# 中声明反斜杠常量字符?

转载 作者:行者123 更新时间:2023-11-30 19:42:08 26 4
gpt4 key购买 nike

如何在 C# 中声明反斜杠常量字符?

char Character_BACKSLASH = '\';

谢谢!

rune

最佳答案

来自 Lexical structure

A character that follows a backslash character (\) in a character mustbe one of the following characters: ', ", \, 0, a, b, f, n, r, t, u,U, x, v. Otherwise, a compile-time error occurs.

所以你只需要使用;

char Character_BACKSLASH = '\\';

enter image description here

关于c# - 如何在 C# 中声明反斜杠常量字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18018264/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com