I am trying to strip all the <br>‘s in a given string.
def extract(a)
a=a.delete("/ (\<br\>)+ /")
puts a
end
extract("e<gr>y<br>t<gh>hello")
is giving egytghhello as output. Why is the <r> of <gr> and <> of gh not getting printed?
This should account for
<br>,<br />and<br/>just in case.Or using a method like your example:
Personally I think is better to have the method return a string and then do
puts extract()than having theputsinside the method.