开发者

Javascript string scanner?

开发者 https://www.devze.com 2023-02-07 08:27 出处:网络
I\'m wondering, is there any way to scan a string in javascript. e.g, I\'ve got a string abcdefdfdfssdfdssdffdq=\"HELLO\"fdndkjdsnkjdnlkdfns I\'d like to scan that string and delete the characters be

I'm wondering, is there any way to scan a string in javascript.

e.g, I've got a string abcdefdfdfssdfdssdffdq="HELLO"fdndkjdsnkjdnlkdfns I'd like to scan that string and delete the characters between q=" and " and replace i开发者_开发百科t with GOODBYE is this possible?


You can use string.replace(regexp/substr,newstring) As in: "abcdefdfdfssdfdssdffdq=\"HELLO\"fdndkjdsnkjdnlkdfns".replace(/".+"/, "\"GOODBYE\"")

0

精彩评论

暂无评论...
验证码 换一张
取 消