Concatenating StyledText

Does anyone have a helper method to concatenate two StyledText object into one?

TextArea1.StyledText.AppendStyleRun(textarea2.Styledtext.StyleRun(0))

Be aware that you have to repeat this for every style in the styled text to be imported

[quote=203106:@Gerd Wilmer]TextArea1.StyledText.AppendStyleRun(textarea2.Styledtext.StyleRun(0))

Be aware that you have to repeat this for every style in the styled text to be imported[/quote]

But I want to concatenate the string values as well as the styles.

The stylerun contains the text

This seems to work just fine :

TextArea3.StyledText.RTFData = TextArea1.StyledText.RTFData+TextArea2.StyledText.RTFData

Be careful with large amounts of text. Pass 15K total, you may be stuck with the beachball forever. There are declares for Mac, though. Can’t quite remember enough to locate them at this moment. Sorry.