black

计算机程序设计综合练习

登录

判断题

下列程序中可以将两个单词互换位置。var re =/(\w+)\s(\w+)/;var str ="John Smith";var newstr =str.replace(re,"$2,$1");

【参考答案】

正确

相关考题

判断题 下列程序中exec使用循环的方式能够找到全部的匹配项。var r =/a/g;var str =’aba’;var array =[];while ((array =r.exec(str))!==null){console.log(’result is:%s,next index at:%d’,array[0],r.lastIndex);}。

判断题 wz 18_hello 900.match(/[a-z]+\s+\d+/ig)返回的结果是["wz 18","hello 900"]。

单项选择题 89abc256-def888’.match(/\D+/g)的返回结果是?()

All Rights Reserved 版权所有©计算机考试题库(PPhuashu.com)

备案号:湘ICP备2020024380号-1