I am working with free marker and java. I have to output result on a txt file. Say i have to print for 3 columns as
`A B C`
In the similar patter. All three attributes as string.
Condition is that, if the length of string referring to A is more than 3 than it should be printed in the next line. That is if the length is 8 then first 3 character will be in first line, 4 to 6 in second and the remaining two in third. Now after that when I have to print for B, i would have to come back to the first line, but the current position for A will be line 3.
How do i do this?
Example
Hi, (required cursor position to print for B).
Hel
lo(current cursor position)
I don’t know freemarker, Here is one approach by just using String manipulation:
StringBuilderHere is code example, might not be optimized but works:
Output: