Web automation for data extraction

I have a multiple line data from that how do I need to get in single line data,

For eg:

  1. I hope
  2.      All are
    
  3.                Good   
    

From above eg , I need:
“I hope All are Good” in single line ,

Kindly give solution for this.

Hi @Balaharish29

InputString="I hope
     All are
               Good   "
Replace=InputString.ReplaceLineEndings(" ").Replace(" ","")
System.Text.RegularExpressions.Regex.Replace(InputString, "\s+", " ")

Hope this helps!!

@Balaharish29

You can try this way also

InputString="I hope
     All are
               Good   "
System.Text.RegularExpressions.Regex.Replace(InputString,"\s+"," ")

Hope this helps!!

@lrtetala Thanks,it’s works

1 Like

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