String s ="java is a"+"platform independent language";
System.out.println("index of t="+s.indexOf('t'));//12
System.out.println("last index of t="+s.lastIndexOf('t')); //27
System.out.println("index of(t,10)="+s.indexOf('t',10)); //12 为什么不是2呢,请指教
System.out.println("last index of(t,60=)"+s.lastIndexOf('t',60)); //27 这里也搞不懂为什么是这个结果
请大家赐教,非常感谢。
System.out.println("index of t="+s.indexOf('t'));//12
System.out.println("last index of t="+s.lastIndexOf('t')); //27
System.out.println("index of(t,10)="+s.indexOf('t',10)); //12 为什么不是2呢,请指教
System.out.println("last index of(t,60=)"+s.lastIndexOf('t',60)); //27 这里也搞不懂为什么是这个结果
请大家赐教,非常感谢。
System.out.println("last index of(t,60=)"+s.lastIndexOf('t',60)); //27 这里也搞不懂为什么是这个结果