Writing text to the middle of a file
<p>Is there a way I can write text to a file from a certain point in the file?</p>

<p>For example, I open a file of 10 lines of text but I want to write a line of text to the 5th line.</p>

<p>I guess one way is to get the lines of text in the file back as an array using the readalllines method, and then add a line at a certain index in the array.</p>

<p>But there is a distinction in that some collections can only add members to the end and some at any destination. To double check, an array would always allow me to add a value at any index, right? (I'm sure one of my books said other wise).</p>

<p>Also, is there a better way of going about this?</p>

<p>Thanks</p>
