How to remove empty Lines from text(string)?

Hi, I have tried to remove empty line using regex, and works fine but i want to do same using split method. can anyone help me with this?. Thanks
Removing_empty_Lines.xaml (11.9 KB)

Not sure I understand it correctly but after the split assign in your workflow try this
in a message box

String.join(environment.NewLine.ToCharArray,RemvoeEmpttyLines)

1 Like

Try this by Assign Activity:
YourString = String.Join(Environment.NewLine,YourString .Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries))

1 Like

@RPA_Python sir, my actual text is
""This is the daily update of the students.

Number of days working:

12

Total number of leave:
NA"

First i need to check for the condition, If my text contains “Number” then, remove the empty lines and my output should starts from Number and i don’t want text which is there before Number .
I only need the output which starts from Number. Please help.(sorry for my english)
output: " Number of days working: 12
Total number of leave:NA"

Hey @Sharu_Wampire

Modified your workflow as your need. please find below attached workflow for your reference.

the input string contains chr(10). used replace functions and left function to get output.

let me know if you need any help. :wink:
Hope this helps you :slight_smile:

Regards,
Vijay

Removing_empty_Lines.xaml (15.3 KB)

1 Like

Hey @Sharu_Wampire

If this post solve the problem, can you please close this thread by marking it as solution.

Regards,
Vijay.

@Vijay_Kumar_C That was working, Thanks for tht.

But, I want to use split method here to remove empty entries and to make the required text to be replaced after semicolon(:).
Final output should be look like this:
" Number of days working: 12
Total number of leave:NA"
Please help

@Sharu_Wampire that is the output you are asking for right and it is giving.

do you want to use only Split Method instead of replace and left methods to get output ??

i am not sure what you are looking for. am i missing something here ??

Regards,
Vijay.

@Vijay_Kumar_C yes, i want to use split method.