Reputation: 135
I have so many strings and i want to print them all one by one. problem is, i have limited width to print the string. so is there any way to know when the width ends and remaining string should come in next line. and words should not be cut.
Thanks in advance...
Upvotes: 1
Views: 927
Reputation: 234807
You can use a StaticLayout to lay out your text into multiple lines that fit within a given width.
Upvotes: 1
Reputation: 143184
What you're looking for is called word wrapping. Search for "word wrap java" and you'll find some examples, like this one.
Upvotes: 1