URLEncoder Encode() Example
Returns the translated String.
URLEncoderclass Encode() method example. This example shows you how to use Encode() method.This method Returns the translated String.
Here is the code:-
/*
* @Program that Returns the translated String.
* Encode.java
* Author:-RoseIndia Team
* Date:-23-Jun-2008
*/
import java.net.*;
public class Encode {
public static void main(String[] args) {
String s =("www.roseindia.net");
//Returns the translated String.
System.out.println("Translated String is : "+URLEncoder.encode(s));
}
} |
Output of the program:-
| Translated String is : www.roseindia.net |
|