TanVuong
(MrErrorRobot)
November 29, 2019, 9:54am
1
Hi, i have a list of strings as follows:
{
“”,
“123sds”,
" ",
“”,
“213213”,
" "
}
I want remove items “” or " ", please help me solve correct.
Thank so much.
Yoichi
(Yoichi)
November 29, 2019, 9:59am
2
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
TanVuong
(MrErrorRobot)
November 29, 2019, 10:03am
4
i not understand what is it mean?
Yoichi
(Yoichi)
November 29, 2019, 10:07am
5
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,
TanVuong
(MrErrorRobot)
November 29, 2019, 10:14am
7
Can you give me a example for it
TanVuong
(MrErrorRobot)
November 29, 2019, 10:16am
8
Here is my list, i want remove the strings have multi space, can you suggest idea for this problem.
Palaniyappan
(Palaniyappan P )
November 29, 2019, 10:30am
10
Yoichi:
How about the following?
Main.xaml (7.1 KB)
This would work for sure for the last scenario
@Yoichi @TanVuong
TanVuong
(MrErrorRobot)
November 29, 2019, 10:35am
11
It’s only remove empty String and not remove the Strings all space.
Yoichi
(Yoichi)
November 29, 2019, 10:38am
12
Hi,
Can you share your data as a file or text?
It’s also Ok if your xaml file.
Regards,
TanVuong
(MrErrorRobot)
November 29, 2019, 10:43am
13
thanks you so much, it’s work for me.