开发者

Html inner-text replace special character in C# or Vb.net

开发者 https://www.devze.com 2023-04-02 20:03 出处:网络
ho开发者_开发百科w to replace special character from client-side html editor post to server in vb or c# whitout replace same charachter in html tags? it usefull to insert to database the correct strin

ho开发者_开发百科w to replace special character from client-side html editor post to server in vb or c# whitout replace same charachter in html tags? it usefull to insert to database the correct string.

input:

<div class="c1">HELLO YOUR Number 1</div>

replace("1","xxx") => replace "1" with "xxx"

output:

<div class="c1">HELLO YOUR Number xxx</div>

not

<div class="cxxx">HELLO YOUR Number xxx</div>


once you get a reference to your div from JavaScript or Server side, just call the replace on div.InnerText instead of calling it on the whole page markup.

0

精彩评论

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

关注公众号