String.Compare的用法
来源:互联网 发布:黑色沙漠城镇优化 编辑:程序博客网 时间:2024/06/04 19:32
- Console.WriteLine("*******************String.CompareTo()*********************");
- String strTestCompare = "abc";
- //strTestCompare.CompareTo("abc")=0
- //strTestCompare.CompareTo("ab")=1
- //strTestCompare.CompareTo("a")=1
- //strTestCompare.CompareTo("b")=-1
- //String.Compare("abc", "a")=1
- //String.Compare("abc", "ab")=1
- //String.Compare("abc", "abc")=0
- //String.Compare("abc", "b")=-1
- Console.WriteLine(String.Compare("abc", "abc").ToString());
- Console.WriteLine("*******************String.CompareTo()********End**********");
- //String.Compare from MSDN
- //unsafe
- //{
- // // Null terminated ASCII characters in an sbyte array
- // String szAsciiUpper = null;
- // sbyte[] sbArr1 = new sbyte[] { 0x41, 0x42, 0x43, 0x00 };
- // // Instruct the Garbage Collector not to move the memory
- // fixed (sbyte* pAsciiUpper = sbArr1)
- // {
- // szAsciiUpper = new String(pAsciiUpper);
- // }
- // String szAsciiLower = null;
- // sbyte[] sbArr2 = { 0x61, 0x62, 0x63, 0x00 };
- // // Instruct the Garbage Collector not to move the memory
- // fixed (sbyte* pAsciiLower = sbArr2)
- // {
- // szAsciiLower = new String(pAsciiLower, 0, sbArr2.Length);
- // }
- // // Prints "ABC abc"
- // Console.WriteLine(szAsciiUpper + " " + szAsciiLower);
- // // Compare Strings - the result is true
- // Console.WriteLine("The Strings are equal when capitalized ? " +
- // (String.Compare(szAsciiUpper.ToUpper(), szAsciiLower.ToUpper()) == 0 ? "true" : "false"));
- // // This is the effective equivalent of another Compare method, which ignores case
- // Console.WriteLine("The Strings are equal when capitalized ? " +
- // (String.Compare(szAsciiUpper, szAsciiLower, true) == 0 ? "true" : "false"));
- //}
- string .Compare的用法
- String.Compare的用法
- string compare用法
- std::string的compare方法
- 注意:NSString - compare: 的用法.
- C++中的string::compare的使用
- String..::.Compare Method (String, String)
- C# string.Compare()方法
- compare two string
- HDU String Compare
- hdu 1894 String Compare
- Hdu 1894 String Compare
- Python string compare
- 1004 String compare
- HDU 1894--String Compare【string】
- hdoj 1894 String Compare 【string】
- C#中字符串的一些常见函数,比如string.Compare()
- iOS compare用法
- 文字竖排工具BY烟锁重楼
- ASP.NET分页技术
- 再次光临草根鸡翅!
- C#调用快捷方式打开相应的应用程序-以解决
- OO五大原则
- String.Compare的用法
- 我欲成佛
- 财务会计1---交易分析
- 语音识别系统
- Men are from Mars, Women are from venus
- OracleDataReader 的数据为什么看一眼就不见了
- 引擎技术研究之实时阴影技术
- unsafe的使用
- how to test the real character number if the string include chinese character,notice one chinese character only calculater one b