标题:非常小的问题,,路过的请帮忙,,小弟在线等
取消只看楼主
yyow3193
Rank: 1
来 自:三峡宜昌
等 级:新手上路
帖 子:165
专家分:0
注 册:2008-6-5
 问题点数:0 回复次数:0 
非常小的问题,,路过的请帮忙,,小弟在线等
public class demo2
{
    public static void main(String[] args)
    {
        String text="fang xing is no one";
             int count=0;
        int index=0;
        if(index!=-1)
        {
            count=count+1;
            index=text.indexOf(' ',index);
            index+=1;    
        }
        System.out.println(count + "," + index);
         }
}
为什么count的结果会是1????
搜索更多相关主题的帖子: 在线 
2008-10-19 19:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-239275-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 2.132867 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved