I have an IF statement with the following condition: out_argument.trim.Contains(“-”)
I have also tried to check if the string is empty as the condition: NOT string.IsNullOrEmpty(out_argument) AND out_argument.trim.Contains(“-”)
The type of out_argument is a string but every time it comes empty since it couldn’t read the specific value, it throws the following error right before entering the IF statement with the conditions mentioned above:
Object reference not set to an instance of an object.
On the THEN side of the IF statement, if out_argument contains “-”, it will proceed to do additional operations, the ELSE side is blank.
First check string is not nothing. If string is not nothing keep nested if in this to check string contains “-” or not.
If out_argument isnot nothing
if out_argument.trim.contains(“-”)
Take Necessary Action
else
Take actions argument is containing “-”
else
Argument is not assigned any value.