-1

_これはおそらく簡単です。 (アンダースコア)を何も(スペース)に置き換えてテキストを返したいと思います。私の試みを見てください。http://jsfiddle.net/NcG78/

これがフィドルからのコードです:

function formatNice(text) {
    $(function() {
        var new = text.replace('_', ' ');

        return new;
    });
}​
4

1 に答える 1

0

不要なjQueryを削除してください!

必要ありません…。

ただ行う:

function formatNice(text) {
   var newt = text.replace('_', ''); //can't use `new` as a variable name.
                                     //it is a "reserved word"
   return newt;
}​
于 2012-07-20T18:41:54.403 に答える