public static String formURLEncode(String string) {
        Preconditions.checkNotNull(string, "Cannot encode null string");

        try {
            return URLEncoder.encode(string, UTF_8);
        } catch (UnsupportedEncodingException uee) {
            throw new IllegalStateException(ERROR_MSG, uee);
        }
    }
public static String formURLEncode(String string) {
        Preconditions.checkNotNull(string, "Cannot encode null string");

        try {
            return URLEncoder.encode(string, UTF_8);
        } catch (UnsupportedEncodingException uee) {
            throw new IllegalStateException(ERROR_MSG, uee);
        }
    }
public static String formURLEncode ( String string ) { Preconditions . checkNotNull ( string , "Cannot encode null string" ) ; try { return URLEncoder . encode ( string , UTF_8 ) ; } catch ( UnsupportedEncodingException uee ) { throw new IllegalStateException ( ERROR_MSG , uee ) ; } }
Translates a string into application/x-www-form-urlencoded format

@param plain
@return form-urlencoded string
Translates a string into application / x - www - form - urlencoded format