gpt4 book ai didi

javascript - 提取 URL 的一部分

转载 作者:行者123 更新时间:2023-11-29 20:16:28 25 4
gpt4 key购买 nike

我需要提取此 URL 的 hello/world 部分:

http://example.com/#tags/hello/world

我对拆分、替换和连接完全感到困惑。最好的方法是什么?

最佳答案

我会这样做:

var newString = oldString.replace('http://example.com/#tags/', '');

关于javascript - 提取 URL 的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6455555/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com