开发者

How to make Use of String startswith and equalsIgnoreCase for string array object

I have to place selected particular set of string from String Array into an开发者_StackOverflow社区other 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.


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


I think what you want to do is this.

String a = "Joker";
if((a.substring(0,1)).equalsIgnoreCase("j")) doSomething();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜