What would be the regular expression to check a string value is "Not null and not empty"
in java?
i tried like this "/^$|\s+/"
, but seems not working.
Considering this: your string can not contain "null" as string:
String.valueOf(input).matches("^null|$");
Otherwise check input != null
and remove null|
from the regex.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With