CodesJava

Easy learning with example program codes

Encode url in java

Encode url in java

package com.codesjava;
 
import java.net.URLEncoder;
 
public class URLTest {
	public static void main(String args[]){
	   try {
            String urlString = "https://codesjava.com";
            String encodeURL=URLEncoder.encode( urlString, "UTF-8" );  
            System.out.println(encodeURL);
           } catch (Exception e) {
            e.printStackTrace();
          }
     }
}

Output

https%3A%2F%2Fcodesjava.com
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status