int n1="This".compareToIgnoreCase("tHe");
int n2="JAVA".compareToIgnoreCase("javaline")
int n3="Java".compareToIgnoreCase("Javits")
结果是n1=4,n2=-4,n3=-8,
这是为什么呢?原因是这样的:
n1:"This" 与 "tHe"比较,从第三个字符开始不同,i比e大4
n2:前面四个字符相同,
If there is no index position at which they differ, then the shorter string lexicographically precedes the longer string. In this case, compareTo returns the difference of the lengths of the strings -- that is, the value:
this.length()-anotherString.length()
n3:同n1
【相关推荐】
1. 特别推荐:“php程序员工具箱”V0.1版本下载
2. Java免费视频教程
本支付接口的特点,主要是用xml文件来记录订单详情和支付详情。代码比较简单,只要将里面的商户号、商户key换成你自己的,将回调url换成你的网站,就可以使用了。通过这个实例也可以很好的了解一般在线支付接口的基本工作原理。其中的pay.config文件记录的是支付详情,order.config是订单详情
3. 关于compareToIgnoreCase()方法的详细介绍
4.compareToIgnoreCase()不区分大小写比较两个字符串









