我正在编写一个可处理字符和字符串的 C# 程序。
String str= textbox1.text;
if(str[0]="'")
{
}
如何在 if 语句中使用“'”?
问候。
最佳答案
像这样,用\
转义'
'\''
和==
String str= textbox1.text;
if(str[0]=='\'')
{
}
关于c# - 在 C# 中使用字符和字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8391343/