What is the function for is null or not null?

What is the function for is null or not null in IF condition?

1 Like

you can use
stringvariable.IsNullOrEmpty() or isNothing(youvariable)

2 Likes

@nadim.warsi Hey Nadim- for example in my excel there is data . Every time if it compares stringvariable.IsNullOrEmpty() or isNothing(youvariable) then it goes to else part right?

do you want to check you extracted datatable?

@nadim.warsi be Clear - In if condition I have given isnull condition - when data is there it always goes to else part - since it returns false.

I want it to go to then

Yes exactly.

@nadim.warsi is there anything like isnotnull? so that it returns true value

if you want to goto then if null then do a Not isNothing(yourDataTable)

1 Like

can u be please clear

  1. variable name - batch = row.item().to string.(It has values)
    I need to give conditions in such a way it goes to then part .

Not batch.IsNullOrEmpty()

When data is there batch.IsNullOrEmpty() = false
and then with negation its true and goes to Then

If no data batch.IsNullOrEmpty() = true
and then with negation its false and goes to Else

4 Likes

@kavinnatarajan …Try this String.IsNullOrWhiteSpace(your_String)