Check if string is null or not

I am working on one automation where bot is scrapping data from one web application.
I need to check if that scrapped string is null or not.
The problem is sometime the scrapped value have only spaces and number of spaces vary every time looks like.

strVar1 =" "

And when I am checking above variable then bot is throwing Exception.!
I have attached the screen shot of the exception please help.

16171048383341521850445897574932|666x500

@ravig1206 - Pleas try …

string.isnullorempty or string.isnullorwhitespace

For you reference…

This is not working I have already checked even I tried to find the length then also bot is throwing same exception message

@ravig1206

Follow belos steps

  1. Assign “” to the strVar1 in default value
  2. Then check condition like this String.IsNullOrEmpty(strVar1.Trim)

It will work

give a try on following condition:

isNothing(yourStringVar) OrElse String.IsNullOrWhitespace(YourStringVar.Trim)

it will return true in case of the string doesnt have a value