I am quite confused here. Today I came across this concept of AttributedString. But I am not able to find the exact difference for String and AttributedString. And more ever I am not able to convert this attributed String to String using the toString(). Can anyone help me with this?
EDIT 1
Actually I want to provide Kerning attrribute for my text. But I don’t know how to do it. Can anyone help me?
A
Stringis a holder for some consecutive list of characters, usually known as “text”."Hello World"is aString. It’s a general-purpose data type that’s used a lot all throughout Java.An
AttributedStringholds text and some attributes. Attributes can be pretty much anything. Usually it’s used for taggin some parts of the text with some language or even providing information about layout arguments (bold, italics, …). It’s a very specific data type that’s used for some specific areas only.Unless you have a specific reason to use
AttributedString, you can pretty much forget that it exists.