var str = "Hello World!"; var result = str.fontcolor("green"); // now font color in 'result' variable is green