I’m taking in a multiline EditText and storing the value into a variable. I then need to print this using Canvas. I know how to do text wrapping within Canvas, but the issue I’m having is that if the user presses enter when entering text into the EditText, this isn’t preserved when storing it to a variable, and therefore when printing with Canvas.
For example, if the user enters:
<code>1
2
3
</code>
<code>1
2
3
</code>
1
2
3
It is printing as:
<code>1 2 3
</code>
<code>1 2 3
</code>
1 2 3
I’ve tried the following, but it just prints:
<code>findingsComp = binding.findings.text.toString().replace("\n".toRegex(), "<br />")
1<br /> 2<br /> 3<br />
</code>
<code>findingsComp = binding.findings.text.toString().replace("\n".toRegex(), "<br />")
1<br /> 2<br /> 3<br />
</code>
findingsComp = binding.findings.text.toString().replace("\n".toRegex(), "<br />")
1<br /> 2<br /> 3<br />