You need to sign in to do that
Don't have an account?
3 Creeks
A bug for function containsOnly() ?
Is this the expected behavior of the function containsOnly()?
String foo = 'garbage'; foo.containsOnly('junk'); //This returns false String foo = ''; foo.containsOnly('junk'); //This returns true system.assertEquals(foo, 'junk'); //This will failSeems like a bug but maybe I am missing something.
In that case it seems like a bug. Did you try to initialize it with null?
You can try contain function which is working fine when string is blank
containsOnly(inputString) returns true if the current String contains characters only from the specified sequence of characters and not any other characters; otherwise, returns false.
Please try the below code.
Hope this helps you!
Best Regards,
Jyothsna