Java – how to check if a String is a boolean!

I stumbled upon this “problem” regularly, for example I have a String value and want to check if this can be parsed to a boolean. Boolean.getBoolean(String name) – javadocs Returns true if and only if the system property named by the argument exists and is equal to the string “true”. System.out.println(“Boolean.getBoolean(true): ” + Boolean.getBoolean(“true”)); System.out.println(“Boolean.getBoolean(false): … Read more Java – how to check if a String is a boolean!