Question Detail

How to convert String object to Boolean Object?

6 years ago Views 1237 Visit Post Reply

My String Value is true and False as some situation I need to convert it into String but now I want it in Boolean Object. How can I convert String object to Boolean Object? I have done something like below code:

Boolean readStatus[] = new Boolean[]{true, true, false, true, true, true};

in loop

for(int i=0; i<readStatus.lenght; i++){

String status=readStatus[i];

}

I want to use here my status as boolean.

if(status){
SOP("Yes");
}else{
SOP("NO");
}


Thread Reply

Anonymous

- 6 years ago

Boolean.valueOf(string)

it will return boolean Value