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