+ 2

Is it possible to delete a character in a paragraph by unicode value?

For example I mean <html> <head> </head> <body> <p>Hello World!</p> </body> And for example, the unicode value for 'o' is 0040F so it's going to delete all the 'o'-s and outputs 'Hell Wrld'

12th Jan 2017, 3:25 PM
Kim Raynor
Kim Raynor - avatar
5 ответов
+ 8
If the unicode is U+100F0, it will be .replace(/[\u100f0-\u102f4]/g, ""). Tell me if it works, I kind of forgot the syntax.
12th Jan 2017, 3:36 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 5
Lmao, if you want to delete the letter 'o', just use JS RegExp... document.getElementsByTagName("p")[0].innerText = document.getElementsByTagName("p")[0].innerText.replace(/o/g, "") // replacing all 'o's to blank characters
12th Jan 2017, 3:30 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 1
I got it but the problem is there are lotsa characters in the unicode and I would mean it to work like replace e.g 100F0-102F4 to ""
12th Jan 2017, 3:33 PM
Kim Raynor
Kim Raynor - avatar
0
lets see i want then i can use the javascript dom functions.mbut if i am a noob amd do not have any idea about a dom function then i can maybe also use a loop for this case. like i can check all the characters one by one and see if they are == "o" if yes then replace that with a blank space
15th Jan 2017, 3:56 AM
ARNAB BISWAS
ARNAB BISWAS - avatar
- 5
gahsyyegr3bd .hsywbsgsjdu63nevdhs :#^#^#₩72&#^ ●$\>_¡{\{●》◇○€$ zhehsiu3hr
14th Jan 2017, 5:45 AM
Asmeet Basnet
Asmeet Basnet - avatar