Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java The Thing About Strings

How is there color on the string results in this video?

The YAY!'s are green and the WAT??!'s are red. How do you make a string have color?

2 Answers

Tony Gemenie
Tony Gemenie
3,781 Points

I can't tell if you're yankin my chain er what Ethan but since there are no bad questions...@ min 1:05 it shows the code when you string.format he enters ANSI_GREEN.

Ok thanks! I was just listening really. I wasn't coding along. I didn't see that, thank you!

 sb.append(String.format("%sYAY!%s", 
                             ANSI_GREEN, 
                             ANSI_RESET));