Most Efficient Way of Combining Large Strings for HTML Response

I think whole code must be rewritten if its written like this function.
There is no need for ‘\n’ between html tags. Why to waste space even there too?

This whole thing is to calculate webstring.length?