社区
JavaScript
帖子详情
怎么把这个字符串中的&字符全部替换成*字符
柴犬AI张群
业界专家认证
2003-09-19 04:44:12
keyword=r&method=keyword&imageField2.x=27&imageField2.y=9
我用
str="keyword=r&method=keyword&imageField2.x=27&imageField2.y=9"
url=str.replace("&","*")
为什么不行呀??
...全文
144
4
打赏
收藏
怎么把这个字符串中的&字符全部替换成*字符
keyword=r&method=keyword&imageField2.x=27&imageField2.y=9 我用 str="keyword=r&method=keyword&imageField2.x=27&imageField2.y=9" url=str.replace("&","*") 为什么不行呀??
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
007james
2003-09-19
打赏
举报
回复
str.replace(/&/g,"*")
把&换成正则式/&/g才可以把所有的*替换
柴犬AI张群
2003-09-19
打赏
举报
回复
好了,谢谢大家
hrong
2003-09-19
打赏
举报
回复
没有问题呀!!
str="keyword=r&method=keyword&imageField2.x=27&imageField2.y=9";
alert(str.replace(/&/g,"*"));
cloudchen
2003-09-19
打赏
举报
回复
str="keyword=r&method=keyword&imageField2.x=27&imageField2.y=9"
url=str.replace(/&/g,"*")
alert(url)
Python
中
的str
字符
串
Python
中
的str
字符
串
特点:
字符
串
是有序的
字符
集合 使用单引号【’】、双引号【”】、三引号【”””或者’’’】
字符
串
是不可不变对象 Python3.0起,
字符
串
就是Unicode类型(utf8) 声明方法 str1 = 'string' str2 = "string2" str3 = '''this's a "string" ''' str4 = """select * from ...
java
字符
变换成别的
字符
_Java把
字符
串
中
的unicode码
替换成
相应的
字符
把
字符
串
中
的unicode码
替换成
相应的
字符
如:\u003d/*** 获取当前的路径* @return*/public static String getCurPath(){String path = null;File dir = new File("");try {path = dir.getAbsolutePath();System.out.println(dir.getCanonicalP...
Java把
字符
串
中
的unicode码
替换成
相应的
字符
把
字符
串
中
的unicode码
替换成
相应的
字符
如:\u003d /** * 获取当前的路径 * @return */ public static String getCurPath() { String path = null; File dir = new File(""); try { path = dir.getAbsolutePath(); S
Python
字符
串
综合练习
Python
字符
串
综合练习,含选择题,填空题,分析题。部分为联考真题。
python
字符
串
str_Python基础【
字符
串
str】
字符
串
操作
字符
串
定义s = 'hello world'
字符
串
索引索引从0开始【0,1,2】s[0] :
字符
串
的第一个
字符
s[1] :
字符
串
的第二个
字符
s[-1] :
字符
串
的最后一位
字符
串
切片s[start:end:step] 从start开始,到end-1结束,步长为step(默认为1)s[:] 所有
字符
s[:3] 显示前3个
字符
s[::-1]
字符
串
倒序s[1:] ...
JavaScript
87,987
社区成员
224,683
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章