Message Boards Message Boards

0
|
1946 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Use StringJoin to join styled characters?

Posted 5 years ago

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 BY: Mia Linda
Posted 5 years ago

Mia,

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

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

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract