question: public String nextString ( char quote ) throws JSONException { char c ; StringBuffer sb = new StringBuffer ( ) ; for ( ; ; ) { c = next ( ) ; switch ( c ) { case 0 : case '\n' : case '\r' : throw syntaxError ( "Unterminated string" ) ; case '\\' : c = next ( ) ; switch ( c ) { case 'b' : sb . append ( '\b' ) ; break ; case 't' : sb . append ( '\t' ) ; break ; case 'n' : sb . append ( '\n' ) ; break ; case 'f' : sb . append ( '\f' ) ; break ; case 'r' : sb . append ( '\r' ) ; break ; case 'u' : try { sb . append ( ( char ) Integer . parseInt ( next ( 4 ) , 16 ) ) ; } catch ( NumberFormatException e ) { throw new JSONException ( "Bad \\u number" ) ; } break ; case '"' : case '\'' : case '\\' : case '/' : sb . append ( c ) ; break ; default : throw syntaxError ( "Illegal escape." ) ; } break ; default : if ( c == quote ) { return sb . toString ( ) ; } sb . append ( c ) ; } } }
target:  Return the characters up to the next close quote character. Backslash processing is done. The formal JSON format does not allow strings in single quotes, but an implementation is allowed to accept them.