Not getting expected output

This is my Input but before i start my actual process i want to bring all the 3 lines into one single line
code is used: (strText.Replace(Environment.NewLine," ")).Trim - but i am not getting expected output, any corrections

I/P
"
He rang the Bell
I rang the Bell
everyone rang the Bell
"

Expected O/P:
“He rang the Bell I rang the Bell everyone rang the Bell”

Hi @devasaiprasad_K

String.Join(" ", Input.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries))

Regards,

@devasaiprasad_K

System.Text.RegularExpressions.Regex.Replace(Str_Text,"\s+"," ")

Thanks for the second solution#

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.