Java StringBuilder append to specific line
<p>Is there any way to append a string to the end of a specific line in a StringBuilder object? 
Here's an example output:</p>

<pre><code>Test
X15 = 3
X18 = 6
X21 = 2
...
...
</code></pre>

<p>I would like to be able to append a string to let's say the line containing X21, therefore the output would be:</p>

<pre><code>Test
X15 = 3
X18 = 6
X21 = 2 This is a test
...
...
</code></pre>

<p>Any thoughts?</p>