All About Class URLEncoder in Java

0
199
Spread the love
  • 29
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    138
    Shares


URLEncoder class defines a single static method which is used to convert a String to its URL-encoded form. The space is converted to + and non alphanumeric characters other than underscore are output as two hexadecimal digits following a percentage sign(%).This technique only works for 8-bit characters.This method is used to determine canonical value of an URL specification so that the users uses only characters from an externally portable subset of ASCII which can be correctly handled by computers around teh globe.

The structure of the class is given as :


public class java.net.URLEncoder extends java.lang.Object{
//methods:
public static String encode(String s);
}
 
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 29
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    138
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here