How do I remove multiple blank lines from a string. I have looked at the examples on stackoverflow and have tried to change my code accordingly but I am not getting the rig
Using regular expressions works, but some people unfamiliar with regular expressions could get confused as to how you lay out your expression. Using the familiar trim command is simply a better choice in my opinion, but in the end I think trim would be faster because it doesn't need to evaluate the regular expression etc.