單項選擇題

使用String對象的indexOf()方法查找字符串”helloworld”中是否包含G,下列語句描述正確的是()。

A.字符串"helloworld"中不包含G字符,indexOf返回0
B.字符串"helloworld"中不包含G字符,indexOf返回null
C.字符串"helloworld"中不包含G字符,indexOf返回-1
D.字符串"helloworld"中不包含G字符,indexOf返回1

微信掃碼免費搜題