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.

1 Like

Hi,

Can you try the following?

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

Regards,

2 Likes

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

Cheers @TanVuong

1 Like

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,

1 Like

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.

1 Like

Hi,

Can you give me a example for it

How about the following?

Main.xaml (7.1 KB)

2 Likes

This would work for sure for the last scenario

@Yoichi @TanVuong

1 Like

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.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.