Currently I am showing messages that I get from DB using only these two replacements:
text = text.replace("\r\n", "<br />");
text = text.replace("\n", "<br />");
but the problem is if there are many consecutive "\n"s I will have lots of
s or white spaces, I just want to make them all one. So what is your suggestion? Is there a quick replace method to make all consecutive \n\n\n\n\n\n\n only one just one br?
"); ? – Jimmy Page Oct 05 '12 at 17:02