比较字符串值 [英] Compare string values

查看:105
本文介绍了比较字符串值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







这是我的字符串值



  string  A =   O10070-A-IT-03-DC-1000; 





这是我的另一个字符串值



  string  B =   O10070-A-IT; 





这是另一个字符串价值



<前lang =c#> 字符串 C = 03;
string D = DC;
string E = 1000;







在这里,请注意我的字符串它看起来像B + C + D + E = A.

现在我想检查A的值这是B,C,D,E的混合。



请帮我比较一下....

解决方案

看看 this [ ^ ]。你可以比较你想要的任何字符串。


hi,



你可以使用stringvalue.contains();



见下面的例子----





  if (stringValue.Contains(anotherStringValue))
{
// < span class =code-comment>做某事//
}







希望这对你有帮助!!!


Hi,


This is my string value

string A="O10070-A-IT-03-DC-1000";



this is my another string value

string B="O10070-A-IT";



this is another string value

string C="03";
string D="DC";
string E="1000";




Here , Please observe my strings it''s look like a B+C+D+E=A.
now i want to check the Value of A this is mixing of B,C,D,E or not.

please help me how to compare this....

解决方案

Have a look at this[^]. You can compare any string you want.


hi,

you can used stringvalue.contains();

see below example----


if (stringValue.Contains(anotherStringValue))
{
    // Do Something //
}




hope this will help you!!!


这篇关于比较字符串值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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