Java Scanner中的next(), nextLine(), nextInt()
JavaScanner中的next()Finds and returns the next complete token from this scanner. A complete token is preceded and followed by input that matches the delimiter pattern.【注1】这里的delimiter pattern默认是正则表达式:\p{javaWhitespace}+,表示匹配任何空白字符,因此next()读取的内容默认去掉前后的空白符号
原创
2022-03-30 20:13:54 ·
1166 阅读 ·
0 评论