To find if a key already exists use $hash.containsKey(key). Remember that if key is case insensitive if it happens to be a string. You can also use $hash.contains(key) mthod which is just a shortcut to containskey method.
Similarly to find a value already existing in the hash; use $hash.containsValue(value). Remember that values are case sensitive if they happens to a be a string.
No comments:
Post a Comment