public static String getQuotedString ( String st ) { Preconditions . checkNotNull ( st ) ; String quotedString = "" ; if ( ! st . startsWith ( SINGLE_QUOTE ) ) { quotedString += SINGLE_QUOTE ; } quotedString += st ; if ( ! st . endsWith ( SINGLE_QUOTE ) ) { quotedString += SINGLE_QUOTE ; } return quotedString ; }
Add single quotes to the string if not present . TestString will be converted to TestString