Makes sure that String
value is not null
by replacing null
with empty string.
Removes a newline character from every sequence of consecutive newline characters.
Removes a newline character from every sequence of consecutive newline characters. If the sequence contained just one newline character without any whitespace before and after it, a space is inserted.
e.g. My hovercraft\nis full of eels.\n\nMy hovercraft is\n full of eels.
becomes
My hovercraft is full of eels.\nMy hovercraft is full of eels.
Useful for multi-line string literals with lines wrapped in source code but without intention of including these line breaks in actual runtime string.