Yarh
Yarh

Reputation: 4627

How to make long string of non breakable spaces?

I wish to add several nonbreakable spaces to the end of the string

"\u00A0".repeat(offset)

however, after 6 or 7 spaces, the new one does not add. Does not matter how many I set 10,20,30 string does not move from the edge (in multiline textview)

Upvotes: 1

Views: 82

Answers (1)

VenomVendor
VenomVendor

Reputation: 15412

myString.padEnd(myString.length + 1000, "\u00A0")

padEnd adds the character to fill given length

Upvotes: 1

Related Questions