How remove "\n"


#1

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.


#2

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.

Bests,
Pablo


#3

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


#4

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


#5

13

can’t use


#6

@Saroch_Kamjikong Can you share what error you are getting


#7

Hi @Saroch_Kamjikong, use:

itemOut.Replace(Environment.NewLine,"")

Take care.


#8

I try it not work.


#9

Share the workflow, please.


#10

Main.xaml (28.3 KB)


#11

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


#12

@Saroch_Kamjikong, change:

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

And change x to String.


#13

@indra @Bernardo_Ferreira

590711

it still. what i’m wrong?


#14

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.


#15

{
“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”
}


#16

@Saroch_Kamjikong, go with:

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


#17

06

Awesome!!!

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

and than you every one.


#18

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


#19

@Saroch_Kamjikong

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

test.xaml (5,0 KB)


#20

thank you so much.
i will try learning.

and sorry for my eng.