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
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
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