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