I have a String array, how do I clear all empty and null strings from this?
Edit: No looping/iterating please (process in bulk)
I have a String array, how do I clear all empty and null strings from this?
Edit: No looping/iterating please (process in bulk)
Sorry how do i use String.empty to clear array items which are null or empty string? What activity do i use
I am not looking to remove strings from array based on index
I don’t know which index items I want to remove, only know that if they are blank or null I want to remove these
E.g.
String1
null
String2
String3
String4
" "
null
String5
I want to remove all these blank or null entries regardless of where they are within the array
Thanks
Hi @DEATHFISH,
1.Iterate the array using for each activity and check if condition if it is null or empty.
2.If it is not null or empty then move to the other array.
3.Then you will have only not null and empty values.
Cheers.
Vashisht.
How do I do this without looping?
i.e. need a method to bulk remove all empty or null items
I used
arr.ToList.RemoveAll(Function(str) String.IsNullOrEmpty(str))
somehow UiPath is reading this expression as an integer
Any idea on how to fix this?
Any help?
This worked for me:
arr.Where(Function(x) Not String.IsNullOrWhiteSpace(x)).ToArray
i have the string
11:30
05:30
10:56
.
.
.
I am add data row for this but in data table it create the 1 empty string…for each item of string
any solution…
I can confirm that this solution worked for me on an Array of Strings
@Tilak_Divakar Yes thanks a lot…this really worked …for both array and list of string …thanks a lot
It worked for m too…Thanks