小编San*_*ano的帖子

C#"或"运算符

我有这个代码:

if (textBox1.Text == "one" || "two")
Run Code Online (Sandbox Code Playgroud)

我试过用|| 和| 添加更多字符串,但它表示它不能应用于"bool"和"string"类型的操作数.我怎样才能做到这一点?谢谢.

c# string operators

-3
推荐指数
3
解决办法
2万
查看次数

标签 统计

c# ×1

operators ×1

string ×1