I am trying to change the colour of all 'A's in the string to green and all 'Z's in the string to red colour. I have a string as:
String input = "LENGTH OF THIS STRING IS GREATER THAN ZERO";
I want to output it on the screen (in SWING, see comments) with all letters 'A' colored to green and 'Z' colored to red.