URLEncoder with sample program

Sample program:


package com.ngdeveloper.com;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class ComparePrintandSystem {
	static String intro="I am naveen kumar working @ www.ngdeveloper.com";
	public static void main(String[] args) throws UnsupportedEncodingException {






URLEncoder Rules:

All the characters (a to z & A to Z) and numbers (0 to 9) remains same.

Space is converted to “+”

All the other characters are converted to hexadecimal values by prefixing with %.

In the above sample program, %40 is the hexadecimal value for @ sign.

Thanks for reading this post……………….!!!

614 total views, 1 views today

About: Mirthbees

Blogger, Innovator, Developer and Enterpreneur. Founder of GuruRecharge, Readymade online recharge script. Lead Developer in Bookrate.in