Java - Write code to create a function and convert 'true' and 't' to boolean Value

Requirements

Write code to create a function and convert 'true' and 't' to boolean Value

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String tfString = "book2s.com";
        System.out.println(booleanValue(tfString));
    }//from w ww.  j  a  va  2  s.  c  om

    public static boolean booleanValue(String tfString) {
        String trimmed = tfString.trim().toLowerCase();
        return trimmed.equals("true") || trimmed.equals("t");
    }

    public static String toLowerCase(String str) {
        return str == null ? null : str.toLowerCase();
    }
}