How remove "\n"

Hello all developer.

i’m new in uipath and c#
i have issue. I extract data from some website. then we have data table right.
but deta in data table is like

and in write line show

I need to remove “\n” because i need value inside \n$$$$\n.

I try use indexof find “\n” it not found.
I try use replace("\n") it not found.
I try use “\r\n”,environment.newline

please help me i try to search and try to do.


Hi @Saroch_Kamjikong,

if you have tried all what you said, you should try with “Split String” actitivity. Split it with “/n” and then use the index of the result array.


Thank for reply.
I will try to do. and update

Hi, I am also new in uipath. You can try with String.Replace(text, “[\r\n\t]”, “”) to remove \n.


can’t use

@Saroch_Kamjikong Can you share what error you are getting

Hi @Saroch_Kamjikong, use:


Take care.

1 Like

I try it not work.

Share the workflow, please.

Main.xaml (28.3 KB)

@Saroch_Kamjikong Change your variable x now its in type generic to string type

@Saroch_Kamjikong, change:

x = itemOut.ToString.Replace(Environment.NewLine,"")

And change x to String.

@indra @Bernardo_Ferreira


it still. what i’m wrong?

Please paste here what the robot is print in the Console, please.

That way I can test it.

PS: I don’t have access to the Silk website.

“message”: “ปกติ 8,888\n8,226\n”,
“level”: “Verbose”,
“logType”: “User”,
“timeStamp”: “17:38:51”,
“processVersion”: “1.0.6766.28117”,
“fileName”: “Main”,
“jobId”: “0b61768e-10a3-4bc7-9fbc-4ca0398be32d”,
“robotName”: “UIPATH”

@Saroch_Kamjikong, go with:

x = System.Text.RegularExpressions.Regex.Replace(itemOut,"[\n]","")




pls explain why can’t use itemOut.Replace()

and than you every one.

@Saroch_Kamjikong Nice. Please mark my post as a solution.

1 Like


As I said in my post, you also can use Split String, take a look (just for have more options to resolve the issue):

test.xaml (5,0 KB)

1 Like

thank you so much.
i will try learning.

and sorry for my eng.

1 Like