2

If I was processing text, how would I know if these symbols are inside the text? Because I want to remove them. I'm new to PHP, I have no idea how to search for these.

▲ - U+25B2 BLACK UP-POINTING TRIANGLE
▼ - U+25BC BLACK DOWN-POINTING TRIANGLE
▴ - U+25B4 SMALL BLACK UP-POINTING TRIANGLE
▾ - U+25BE SMALL BLACK DOWN-POINTING TRIANGLE

Thank you,

PS: I am not sure that they are UTF, they might also be ASCII.

Thank you!

1 Answer 1

2

Trivially, str.replace(/[▲▼▴▾]/g, '').

Or, if for some weird reason your JavaScript is not Unicode, you could write the equivalent str.replace(/[\u25b2\u25bc\u25b4\u25be]/g, '').

Sign up to request clarification or add additional context in comments.

4 Comments

How would I put the triangles in VI for example?
Copy-paste? Or <Ctrl-V>u25b2 (at least Vim; I haven't worked with plain VI in decades).
Would this work on php? (besides the str.replace of course) ?
preg_replace("/[▲▼▴▾]/", "", $str).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.