string.compare(str1,str2)和str1.compareto(str2)之间的区别 [英] Difference between string.compare(str1,str2) and str1.compareto(str2)
本文介绍了string.compare(str1,str2)和str1.compareto(str2)之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨....
我是C#的新手。我没有得到比较和比较到C#的区别。
string.compare(str1,str2)和str1.compareto(str2)之间的区别
??
Hi....
I am newbie in C#.I am not getting what is difference between compare and compareto to in C#.
Difference between string.compare(str1,str2) and str1.compareto(str2)
??
推荐答案
< br $> b $ b
看看这里:
http://social.msdn.microsoft.com/Forums/en- US / 44fafe4a-324f-4fe5-9c79-477e68923f96 / what-si-difference-stringcompare-stringcompareto-and-in-c?forum = csharpgeneral [ ^ ]
简短说明:比较()
非常相似的CompareTo( )
,但如果第一个字符串可以null
,则非常有用,因为Compare()
可以处理null
字符串。
Hi,
Have a look here:
http://social.msdn.microsoft.com/Forums/en-US/44fafe4a-324f-4fe5-9c79-477e68923f96/what-si-difference-between-stringcompare-stringcompareto-and-in-c?forum=csharpgeneral[^]
Short explained:Compare()
is very similar toCompareTo()
, but is useful if the first string can benull
, becauseCompare()
can handlenull
strings.
你好ProgramFox
感谢您的回复。
我读了这个链接,但我没有得到.....
Hi ProgramFox
Thanks for reply.
I read this link but I am not getting.....
这篇关于string.compare(str1,str2)和str1.compareto(str2)之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文