阅读下列程序,请写出该程序的功能。 import java. util.*; public class Class1{ public static void main(Srting args[]){ Date date1=new Date(); System. out. println (datel); String t=datel.toString(); int endPos=t.indexOf(`C'); t=t.substring(11,endPos); System. out println(t); } }
阅读下列程序,请写出该程序的功能。 import java. util.*; public class Class1{ public static void main(Srting args[]){ Date date1=new Date(); System. out. println (datel); String t=datel.toString(); int endPos=t.indexOf(`C'); t=t.substring(11,endPos); System. out println(t); } }
使用String对象的indexOf()方法查找字符串”helloworld”中是否包含G,下列语句描述正确的是()。 A: 字符串"helloworld"中不包含G字符,indexOf返回0 B: 字符串"helloworld"中不包含G字符,indexOf返回null C: 字符串"helloworld"中不包含G字符,indexOf返回-1 D: 字符串"helloworld"中不包含G字符,indexOf返回1
使用String对象的indexOf()方法查找字符串”helloworld”中是否包含G,下列语句描述正确的是()。 A: 字符串"helloworld"中不包含G字符,indexOf返回0 B: 字符串"helloworld"中不包含G字符,indexOf返回null C: 字符串"helloworld"中不包含G字符,indexOf返回-1 D: 字符串"helloworld"中不包含G字符,indexOf返回1
智慧职教: indexOf() 方法对大小写敏感
智慧职教: indexOf() 方法对大小写敏感
若字符串的indexOf()方法查找失败,则返回( )
若字符串的indexOf()方法查找失败,则返回( )
关于String类的indexOf说法不正确的是( )
关于String类的indexOf说法不正确的是( )
若有语句 s = “ java ” ; 则查找 s 中字母 a 最后出现的位置的语句是()。 A: s . lastIndexOf ( ‘ a ’) ; B: indexOf ( s ,‘ a ’ ) ; C: charAt ( 2 ) ; D: s .indexOf ( ‘ a’ );
若有语句 s = “ java ” ; 则查找 s 中字母 a 最后出现的位置的语句是()。 A: s . lastIndexOf ( ‘ a ’) ; B: indexOf ( s ,‘ a ’ ) ; C: charAt ( 2 ) ; D: s .indexOf ( ‘ a’ );
indexOf()方法在数组元素检索时与运算符“==”相同
indexOf()方法在数组元素检索时与运算符“==”相同
从一个字符串中取出指定位置的字符,采用String类中的()方法。 A: charAt() B: endsWith() C: A、charAt()B、endsWith()C、indexOf()D、substring() D: indexOf()
从一个字符串中取出指定位置的字符,采用String类中的()方法。 A: charAt() B: endsWith() C: A、charAt()B、endsWith()C、indexOf()D、substring() D: indexOf()
1. 对字符串”ababcdabcdefg”使用indexOf(‘a’)和lastIndexOf(‘a’),的运行结果是( )
1. 对字符串”ababcdabcdefg”使用indexOf(‘a’)和lastIndexOf(‘a’),的运行结果是( )
字符串的替换函数是() A: replace() B: indexOf() C: chartAt() D: lastIndexOf()
字符串的替换函数是() A: replace() B: indexOf() C: chartAt() D: lastIndexOf()