public static boolean isString(String str){
  return ((str.startsWith("\"") && str.endsWith("\"")) || (str.startsWith("'") && str.endsWith("'"))) && str.length() > 1;
}

public static boolean isString ( String str ) { return ( ( str . startsWith ( "\"" ) && str . endsWith ( "\"" ) ) || ( str . startsWith ( "'" ) && str . endsWith ( "'" ) ) ) && str . length ( ) > 1 ; }
check the given string is a string literal
