for循环if条件除空格

int j =0;
        for(int n=0;n<str1.length();n++)
        {
            String s=str1.substring(n,n+1);
            if(s.equals("i")){
                j++;
            }
            
        }
        System.out.println(j);

posted @ 2016-01-12 17:07  小美好。  阅读(367)  评论(0编辑  收藏  举报