我想知道如何用JavaScript中的大写字母替换捕获组。这是到目前为止我无法尝试的简化版本:
> a="foobar"
'foobar'
> a.replace( /(f)/, "$1".toUpperCase() )
'foobar'
> a.replace( /(f)/, String.prototype.toUpperCase.apply("$1") )
'foobar'
您能解释一下这段代码有什么问题吗?
湖上湖
翻阅古今
天涯尽头无女友
随时随地看视频慕课网APP