How would I, given a string like this (for example), remove all break (<br>,<br />, and any other form
) tags from only the beginning and end of the string?
Original string:
<br>Hello, World! https://www.youtube.com/watch?v=NU7W7qe2R0A<br><br>
Output:
Hello, World! https://www.youtube.com/watch?v=NU7W7qe2R0A
If the original string has <br>
tags in the middle of the string, i.e.:
<br>Hello, World!<br><br>https://www.youtube.com/watch?v=NU7W7qe2R0A<br><br>
It should output:
Hello, World!<br><br>https://www.youtube.com/watch?v=NU7W7qe2R0A
How would I achieve this results?