I'd like to prefix each line with it's line number and retain the line format.
This is not for source code.
For example, I have the following XML:
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>
What I would like to format as and output:
1 <filter-mapping>
2 <filter-name>extensionsFilter</filter-name>
3 <url-pattern>/faces/*</url-pattern>
4 </filter-mapping>
Looking at the String functions, I am unsure about how to go about this. Prefix the line number should be no problem, but what about retaining the format?
Thanks,