Remove item in List String

Hi, i have a list of strings as follows:
{
“”,
“123sds”,
" ",
“”,
“213213”,
" "
}
I want remove items “” or " ", please help me solve correct.
Thank so much.

Hi,

Can you try the following?

listString = listString.Where(function(x) x.trim<>"").ToList

Regards,

Here you go with a xaml
list.zip (2.0 KB)

Cheers @TanVuong

i not understand what is it mean?

Hi,

It’s anonymous function.
It evaluates if the trimed content is not empty string. (If empty string, the item is removed by where method)

Regards,

Can you give me a example for it :grinning:

Here is my list, i want remove the strings have multi space, can you suggest idea for this problem.

Hi,

Can you give me a example for it

How about the following?

Main.xaml (7.1 KB)

This would work for sure for the last scenario

@Yoichi @TanVuong

It’s only remove empty String and not remove the Strings all space.

Hi,

Can you share your data as a file or text?
It’s also Ok if your xaml file.

Regards,

thanks you so much, it’s work for me.