tags:

views:

59

answers:

2

I have to place selected particular set of string from String Array into another array, here I need to combine both equalsIgnorecase with String startsWith method.

If I have comparator:

String a= "j";
if(a.startswith("j"))

it returns true only "j", but here i need "J" and "j" has case sensitive, how can I get this.

Thanks in advance.

+1  A: 

I think what you want to do is this.

String a = "Joker";
if((a.substring(0,1)).equalsIgnoreCase("j")) doSomething();
blindstuff
+1 thanks for your answer
MGS
+1  A: 

if("j".equalsIgnoreCase(a.substring(0, 1)))

franklins