compressed the highlightStringWithColor, underlineText, clearFormat functions