# Printing text in colour without having a newline added automatically at the end

I want to write a line of letters one by one, each with a different font colour and background. WriteString with stdout lets me write all the letters in the same line, but it can only be used with plain text. Is there any way to do the same but with coloured text? My best guess was to create a list with the coloured text and then join it with StringJoin, but it does not work. Yes, I am quite new to Mathematica.

So, I want to start with something like {A,B,C} and get ABC, with each letter with different color and background. Any ideas?

• With lst = {Style["A", Red], Style["B", Blue], Style["C", Green]}; you can use Row[lst] or StringJoin[ToString[#, StandardForm] & /@ lst]? – kglr May 9 '18 at 17:32
• @kglr yes, that solves it, thank you!! – John May 9 '18 at 17:49
• John, posted the comment as an answer. Welcome to mma.se. – kglr May 9 '18 at 18:06

lst = {Style["A", 72, Red, Bold, Background -> Yellow],
Style["B", 72, Blue, Bold, Background -> Pink],
Style["C", 72, Black, Bold, Background -> Cyan]};


You can use

Row[lst] (* or *)
StringJoin[ToString[#, StandardForm] & /@ lst]


to get