How to pass multiple variable to check is variable empty

Hi Guys
I have a scenario where I have a more than 20 variable and I need to check each variable contain some value.
I can use string.IsNullOrEmpty(var) function but I need a way , where I can pass multiple variable like (var1,var2 …n) to check if any value is empty
, bot will not add item in queue.

Hi @Aleem_Khan

Put it like this

var.Tostring=β€œβ€œAnd var2.Tostring=”” And var3.ToString=β€œβ€

Hope it solves your issue

Thanks
Robin

@Aleem_Khan

Use If condition as string.IsNullorEmpty(var1) OR string.IsNullorEmpty(var2) etc…,

OR

Var1.ToString=β€œβ€ OR Var2.ToString = β€œβ€

Then β†’ some variable is wrong
Else β†’ all variable are not null

Thanks

{var1, var2, var3}.Any(Function (x) String.IsNullOrEmpty(x.Trim))
we assume alll vars of datatype string

5 Likes

Hi @Aleem_Khan ,

Are the values in variables fetched from an datatable?

Thanks

This is i already following

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