Message Boards Message Boards


Use StringJoin to join styled characters?

Posted 5 months ago
1 Reply
2 Total Likes

End result will be the PNG below, but when I use StringJoin to join Styled Characters, error pop up StringJoin::string: String expected at position 1 in StringJoin[M]. Possible issue is StringJoin works only with explicit strings, while TreeForm[Style["M",Red]] shows it is not a String and thus cannot use StringJoin, how could I make it?

Posted 5 months ago


You have to convert the Style to a StandardForm String before StringJoin.

ToString[Style[#, RandomColor[], 30], StandardForm] & /@ Alphabet[] // StringJoin

enter image description here

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract