文字列をjsに置き換えると、ReplyText = ReplyText.Replace( "aa"、 "");
このようにして、文字列内の最初のAAのみを交換できます。すべてのAAを交換する必要がある場合があり、この方法は使用できません。 。
次の方法を参照として使用できます。
コードコピーは次のとおりです。
function del_html_tags(str、allallydo、cheplywith){
var e = new regexp(allowdo、 "g");
words = str.replace(e、falpplesswith);
単語を返します。
}
strはターゲット文字列です
交換するのは誰ですか
置き換えられたものは何ですか?
var ReplyText = "<p>敬意と敬意と敬意を払う</p> <p> <br/> </p> <p>敬意と敬意を払う</p> <p> <p> </p> </p> <p>敬意と敬意を払う</p> <p> <Br/> </p>";
例えば:
コードコピーは次のとおりです。
ReplyText = del_html_tags(ReplyText、 "<br />"、 "");
ReplyText = del_html_tags(ReplyText、 "<p>"、 "");
ReplyText = del_html_tags(ReplyText、 "</p>"、 "");
あなたはそれを手に入れることができます
「敬意と敬意と敬意と敬意を払う」