How to read txt file and save as a single string in java in order to split it by a certain character : <p>I'm new to to java language &amp; am finding trouble finding to:</p>

<pre><code>1. read a txt file
2. save entire txt file as single string
3. once I have the txt file content as a string, break the string (by a certain character such as a new line) into an array of strings that I can work with.
</code></pre>

<p>If you may include the import statements that are required, that would be helpful as well as a new java programmer.</p>

<p>I was working with the <code>BufferedReader</code> but I believe that only gives me the current line to work with.</p>

<p>I did see that <code>BufferedReader</code> had a <code>lines()</code> method which returns a stream of <code>Stream&lt;String&gt;</code>.</p>
