Is there any way to check if string does not contain value

I have a String StrAmount I need to make sure it does not contain “0”,

is there any method to check it StrAmount does not contain 0.

Thanks

not StrAmount.Contains("0")

Hello @Ulhas_Guttikar ,

  1. If you want to check if String does not contain any value you can use :

String.IsNullorEmpty( StrAmount)

This will return you a boolean result of true or false.

  1. If you want to check if your string contains “0”

StrAmount.Contains(“0”)

This will return you a boolean result of true or false.

Or if you want to check if your string is equal to “0”

StrAmount.Equals(“0”)

This will return you a boolean result of true or false.

Regards,
Rohith

Hello @Ulhas_Guttikar

You can do it using contains method.
StrAmount.Contains(“0”). output will be True if “0” contains
or
not StrAmount.Contains(“0”). output will be False if “0” contains

You can use a if condition to make the condtion then.

Thanks

Thank you for your time and ideas guys. it was very helpful for me

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