当前位置:网站首页>URL append parameter method, considering #$ Situation of
URL append parameter method, considering #$ Situation of
2022-06-28 12:11:00 【A cup of bitter mustard】
public static String addParamToUrl(String url, String param) {
if (url.contains(param)) {
return url;
} else if (url.contains("?")) {
return url.contains("#") && url.indexOf("#") > url.indexOf("?") ? url.replaceFirst("#", "&" + param + "#") : url + "&" + param;
} else {
return url.contains("#") ? url.replaceFirst("#", "?" + param + "#") : url + "?" + param;
}
}边栏推荐
- Day39 prototype chain and page fireworks effect 2021.10.13
- Redis hash hash type string (5)
- FTP protocol for Wireshark packet capture analysis
- 【C语言】二叉树的实现及三种遍历
- 【北京航空航天大学】考研初试复试资料分享
- Day28 strict mode, string JS 2021.09.22
- 水果FL Studio/Cubase/Studio one音乐宿主软件对比
- Mutual conversion between mytipartfile and file
- Web3 security serials (3) | in depth disclosure of NFT fishing process and prevention techniques
- AcWing 610. Salary and bonus (implemented in C language)
猜你喜欢

赛尔号抽奖模拟求期望

Data analysis learning notes

Day29 JS notes 2021.09.23

Day33 JS note event (Part 2) September 28, 2021

【C语言】结构体嵌套二级指针的使用

Django -- MySQL database reflects the mapping data model to models

Is it feasible to be a programmer at the age of 26?

RemoteViews的作用及原理

Oracle date format exception: invalid number

Multi dimensional monitoring: the data base of intelligent monitoring
随机推荐
Day39 prototype chain and page fireworks effect 2021.10.13
Convert black mask picture to color annotation file
6. calculation index
Random forest and poetry maker trained by AMR
Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
day28 严格模式、字符串 js 2021.09.22
【C语言】判断三角形
Redis 原理 - List
PrecomputedTextCompat用法及原理
【C语言】文件读写函数使用
day39 原型鏈及頁面烟花效果 2021.10.13
Web3安全连载(3) | 深入揭秘NFT钓鱼流程及防范技巧
What is the main chain system?
fatal: unsafe repository (‘/home/anji/gopath/src/gateway‘ is owned by someone else)
Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
Android应用安全之JNI混淆
AGCO AI frontier promotion (2.16)
Chendanqi, Fang Fei, guquanquan and Li Bo won the prize, and the list of Sloan research award in 2022 was released
What is DAPP system development and analytical understanding
Cohere, a large model company, completed the round B financing of US $125million