How to replace enter key or next line on text with ""

Hi,

I am having challenges with removing enter keys from a series of data scraped in UiPath. Data appearing on output pane is:

Employee ID: 12345
Employee Name: John D
Group: RSR

I am trying to remove the enter keys in between the 3 line items with .Replace but am unsuccessful.

Thanks in advance!

@richmond.bpoi, Lets say you have the following in a string (str),

Implement either of these mentioned below in an Assign Activity,

  1. str.Replace(vblf,“desired replacing character”)
  2. str.Replace(Environment.NewLine,“desired replacing character”)

Note: Go through forum posts.

Regards,
Dominic :slight_smile:

9 Likes

thank you very much!!! the second one worked but not the first.

First one should work if u write it like this:

str.Replace((vblf),“desired replacing character”)

var Str_Lines =
“Employee ID: 12345
Employee Name: John D
Group: RSR”
use Assing component.
C# Str_Lines = Str_Lines.Replace(Convert.ToChar(13).ToString(),“”).Replace(Convert.ToChar(10).ToString(),“”)
VB Str_Lines = Str_Lines.Replace(Chr(13),“”).Replace(Chr(10),“”)
Final , Str_Lines =“Employee ID: 12345Employee Name: John DGroup: RSR”