[]
An IRichText object contains a collection of ITextRun objects that together define the text and character-level formatting for a cell. You can obtain this interface from IRange.getRichText() and use it to append formatted text runs or iterate through existing text runs.
IRichText richText = worksheet.getRange("A1").getRichText();
ITextRun run1 = richText.add("Document ");
run1.getFont().setBold(true);
ITextRun run2 = richText.add("Solutions");
run2.getFont().setColor(Color.GetBlue());
forEach, iterator, spliteratorThe new text run is appended to this IRichText and can be used to apply character-level formatting to the added text.
IRichText richText = worksheet.getRange("A1").getRichText();
ITextRun textRun = richText.add("Document Solutions");
textRun.getFont().setBold(true);
text - The text to add to the current rich text object.ITextRun.ITextRun objects.
IRichText richText = worksheet.getRange("A1").getRichText();
richText.add("Document ");
richText.add("Solutions");
int count = richText.getCount();
ITextRun objects in this rich text object.ITextRun objects.Returns the concatenated text content of the rich text without exposing individual text run formatting.
IRichText richText = worksheet.getRange("A1").getRichText();
richText.add("Document ");
richText.add("Solutions");
String plainText = richText.getPlainText();
ITextRun objects.