gorby
(gorby)
1
こんにちは
UiPath Studio 2022.4.3EnterPrise Editionユーザです。
FoeEachRowアクティビティの内部に配置したElse Ifアクティビティの条件文で
Rowに ","が10個連続 が含まれる場合、またはString.Emptyの場合にTrueになる条件文を書きたくて下記の構文を書きましたがTrueになりません。正しい書き方をご教示ください。
Row.ItemArray.Contains(",,,,,,,,,,") OrElse String.IsNullOrWhiteSpace(Row.ItemArray.ToString)
Anil_G
(Anil Gorthi)
2
@gorby
When you say 10 consecutive , you mean 10 empty columns ?
When you say empty all columns are empty?
if so the condition above is wrong
you need to use String.Join(",",Row.ItemArray).Contains(",,,,,,,,,,") OrElse String.Join("",Row.ItemArray).Contains("")
cheers
gorby
(gorby)
3
No, Pls see below. This dt is made by one column.
String.Empty
consecutive 10"," in one column
String.Empty
String.Empty
Anil_G
(Anil Gorthi)
4
@gorby
then also you need to join…if row
then String.Join("",row.itemArray).Contains(",,,,,,,,,,")
cheers
Anil_G
(Anil Gorthi)
5
@gorby
can you please show a screenshot or an excel how it looks that would help
cheers
gorby
(gorby)
6
I cannot show you screenshot due to internal policy.
Is the next Syntax acceptable?
Row.Contains(“,”)
Anil_G
(Anil Gorthi)
7
@gorby
okay then say this do you want to check if atleast one column in a row is empty or is havign 10 commas?
cheers
Anil_G
(Anil Gorthi)
9
@gorby
try this
Row.ItemArray.Select(function(x) x.Trim).Contains(",,,,,,,,,,") OrElse String.IsNullOrWhiteSpace(Row.ItemArray.ToString)
What you write looks correct may be it might have some extra characters
cheers