The fastest way to find strings in text files using java

What is the fastest way to check whether a file contains a string or number?

Solution

Take a look at the scanner class attached to JDK (see official documentation) You will be able to skip some part of the input (in this case, a text file) and match your desired regular expression I'm not sure if this is the most effective way, but sure enough - it's simple You can also view this example, which will help you get started

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>