Baby123
(Baby)
September 15, 2023, 11:10am
1
Hi Team,
I have one string
status=
“Rejected
2/13/2023” like this
I have one excel with status coloum.when I am extracting each data in string using for each row in datatable activity.
But the output will be
“Rejected
2/13/2023”.
I want string like this
Rejected 2/13/2023 .
I am attaching input sheet for your reference.
!
How to change this input data:
Rejected
2/13/2023
I want Output like this :
Rejected 2/13/2023
Can any one suggest me .
Thanks in advance.
Regards,
Baby
2 Likes
Hi @Baby123 ,
Could you check with the below expression :
String.Join(" ",System.Text.RegularExpressions.Regex.Split(YourInputStr,"\r?\n"))
Baby123
(Baby)
September 15, 2023, 11:41am
3
Hi @supermanPunch ,
Thank you so much for quick response.
It’s working
1 Like
Anil_G
(Anil Gorthi)
September 16, 2023, 2:02am
4
@Baby123
You can directly use a replace activity as well
System.Text.RegularExpressions.Regex.Replace(str.Trim,"\r?\n"," ")
Cheers
1 Like
Parvathy
(PS Parvathy)
September 16, 2023, 2:21am
5
Hi @Baby123
Try this:
CurrentRow("Status").YoString.ReplaceLineEndings(" ")
Hope it helps!!
Hi
There are many approaches
Let’s go from simple one
StringResult = yourString.Replace(Environment.newLine,“”)
StringResult = String.Join(“ “, Split(yourstring, Environment.Newline))
StringResult = String.Join(“ “, yourString.Split(Environment.NewLine.TocharArray))
stringResult= Regex.Replace(yourString, “\t|\n|\r”, “”)
Hope any of these methods helps
Cheers @Baby123
4 Likes
Hope it’s clarified @Baby123
If yes
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has fo…
Hi you can try this simple way
str = "Rejected
2/13/2023"
System.Text.RegularExpressions.Regex.Replace(str,"\r?\n"," ")
@Baby123
system
(system)
Closed
March 18, 2024, 9:37am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.