Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加自己的书籍,最后一页会多出一个字符 #16

Open
jackfengtianqi opened this issue May 27, 2019 · 1 comment
Open

添加自己的书籍,最后一页会多出一个字符 #16

jackfengtianqi opened this issue May 27, 2019 · 1 comment

Comments

@jackfengtianqi
Copy link

添加txt文档,大部分的最后一页的末尾会多出一个字符。这个字符大概是文章的第一个字,大佬帮看下,如何解决。

@jackfengtianqi
Copy link
Author

问题已解决。
public int next(boolean back){
position += 1;
if (position > bookLen){
position = bookLen;
return -1;
}
char result = current();
if (back) {
position -= 1;
}
return result;
}

第一个判断里改成position+1 > bookLen就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant