操作员提出错误 [英] operaters raise the error

查看:73
本文介绍了操作员提出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个字符串ds,ds1就像



i have two strings ds,ds1 like as

string ds,ds1;





保持关系为





maintain relation as

if(ds1>=ds)
{

}



但是提高错误就像



operters无法申请字符串



please帮助我。



谢谢你


but raise the error like as

operters can not applied for string

please help me.

thank u

推荐答案

https://msdn.microsoft.com/en-us/library/84787k22(v = vs.110)的.aspx [ ^ ]


您无法比较该运算符的两个字符串。如果你想比较长度或比较相等,我的解决方案是找到方法支持比较C中的两个字符串

在这里读取msdn



eg

you cannot compare for two string by that operator. If you want to compare the length or compare equal, my solution is find the method support compare two string in C#
read msdn here

eg
string MyString = "Hello World!";
Console.WriteLine(String.Compare(MyString, "Hello World?"));


这篇关于操作员提出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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