简体   繁体   中英

Need to remove extra string from the URL

I need to remove extra cobra string from the below URL:

URL: https://cigs-dev.capgroup.com/cobra/cobra/broker/

Result: https://cigs-dev.capgroup.com/cobra/broker/

You can try to use the following code:

String url = "https://cigs-dev.capgroup.com/cobra/cobra/broker/";  
String url0 = url.substring(0,30);  
String url1 = url.substring(36,49);  
String newUrl = url0 + url1;  
System.out.println(newUrl);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM