Behavior of using \\Z vs \\z as Scanner delimiter

我的未来我决定 提交于 2019-12-05 11:31:00

As Pattern documentation states

  • \z The end of the input
  • \Z The end of the input but for the final terminator, if any

I suspect that since Scanners buffer size is set to 1024,

354  private static final int BUFFER_SIZE = 1024; // change to 1024;

Scanner reads this amount of characters and uses it as current input, so \z can be used here to represent its end, while \Z can't because it is not "final terminator" (there are more elements in entire input to read).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!