使用String对象的indexOf()方法查找字符串”hello world”中是否包含G,下列语句描述正确的是( )
A: 不包含G,返回0
B: 不包含G,返回null
C: 不包含G,返回-1
D: 不包含G,返回1
A: 不包含G,返回0
B: 不包含G,返回null
C: 不包含G,返回-1
D: 不包含G,返回1
C
举一反三
- 使用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
- 使用String对象的indexOf()方法查找字符串”helloworld”中是否包含G,下列语句描述正确的是()。 A: A字符串"helloworld"中不包含G字符,indexOf返回0 B: B字符串"helloworld"中不包含G字符,indexOf返回null C: C字符串"helloworld"中不包含G字符,indexOf返回-1 D: D字符串"helloworld"中不包含G字符,indexOf返回1
- 中国大学MOOC: 对于一个字典对象d,如果需要判断d中是否包含键为x的元素(包含返回True,不包含返回False),则可以使用的语句包括( )。
- 有关RegExp类的test方法正确的结论是: A: test用于测试字符串string是否包含匹配参数regexp的文本,如果包含则返回1;否则,返回0。 B: java/i.test("ECMAScript");将返回true C: .test(s)等价于(r.exec(s)!=null) D: java/i.test("JavaScript");返回false
内容
- 0
String 类的一个访问器方法是_______方法,它返回字符串对象包含的字符数。
- 1
对于一个字典对象d,如果需要判断d中是否包含键为'x'的元素(包含返回True,不包含返回False),则可以使用的语句包括( )。 A: d.get('x')!=None B: d.get('x')!=default C: 'x' in d D: d.has('x')
- 2
对于一个字典对象d,如果需要判断d中是否包含键为'x'的元素(包含返回True,不包含返回False),则可以使用的语句包括( )。 A: d.get('x')!=None B: d.get('x')!=default C: 'x' in d D: d.has('x')
- 3
Math.random 方法返回0~1,并且包含0和1
- 4
若函数体中不包含return()语句,则不返回任何值