There are few lines between the sentences which I don’t want it like the new line between every sentence, for example, there is a new line between"Hi" and “I am Anmol.”
How can I do that?
I want result like this:
Hi!
I am Anmol.
How are you?
I am good.
ArrStr = Str.split(Environment.NewLine.TocharArray)
—> ArrStr (Array Of String), str (your string)
—> this remove all newlines from string. As you know there are 2 newlines in every 2 lines.
String join using 1 newline. Str = String.Join(Environment.NewLine,ArrStr)
—>String.join to join array of string using 1 newline as you want it.