How to convert multiple line string to single line string?

Hello Everyone,

I need a help to convert multiline string to single line string as mentioned below;

Input -
“Hello
World”

Output must be - “Hello World”.

I tried removing new line by using Environment.newline and vbCrlf.

Thanks!

Try this:

input = input.Replace(vbLf, “”).Replace(vbCr, “”)

4 Likes

Hi @satyam.baviskar

Welcome to uipath community

You can try with Regex method

System.Text.RegularExpressions.Regex.Match(YourString,"\W"," ").Tostring

Regards
Gokul

2 Likes

Thank you so much it worked.

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