0

I've been having one heck of a time with this. I want to limit field width AND left justify these items. For example, in %2$-13s

I want to left justify this and limit the length to 13 characters. so if argument 2 is 15 characters long, it will only print 13 of those characters

result.setFormat("  %1$-25s %2$-13s %3$.5s %4$-7s %5$-9s %6$-10s %7$-5s "
                + "%8$-4s %9$-6s %10$-7s %11$-8s %12$-11s %13$-4s");

How do you do this?

Josh
  • 341
  • 5
  • 26
  • What output are you currently getting, and what is wrong with it? – David Conrad Mar 08 '19 at 18:46
  • Well, Pshemo had the EXACT answer I needed but his post is deleted. So I would have accepted his answer. I also searched for quite some time to find this answer and couldn't find it. Thanks though – Josh Mar 08 '19 at 19:03
  • 1
    I noticed that main idea behind my answer was [already posted](https://stackoverflow.com/a/27060643) in duplicate question so there is no need for repetition (also marking question as duplicate prevents others from posting new answers so letting only my answer stay wouldn't feel right). – Pshemo Mar 08 '19 at 19:04
  • Eh either way, I searched for about 30 mins and got your answer much faster - thanks for the help ^.^ – Josh Mar 08 '19 at 19:05

0 Answers0