简体   繁体   English

在C#中使用字符和字符串

[英]Working with chars and strings in C#

I'm writing a C# program that works with chars and strings. 我正在编写一个可以处理字符和字符串的C#程序。

String str= textbox1.text;
if(str[0]="'")
{
}

How I can use "'" in my if statement? 如何在if语句中使用“'”?

Regards. 问候。

like this, escape ' with \\ 这样,逃避'\\

'\''

and == ==

String str= textbox1.text;
if(str[0]=='\'')
{

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM