string to boolean apex code example Example: apex string to boolean Boolean b = Boolean.valueOf(str);