简体   繁体   English

需要从 URL 中删除额外的字符串

[英]Need to remove extra string from the URL

I need to remove extra cobra string from the below URL:我需要从下面的 URL 中删除额外的眼镜蛇字符串:

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

Result: https://cigs-dev.capgroup.com/cobra/broker/结果: 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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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