求这样一个字符串函数???

kevin_hz 2003-08-21 08:24:08
比如说

PFP_00316_00

有这样一个字符串

我只想将 第三个P 替换成D
别的P不替换
...全文
19 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
changechange 2003-08-22
  • 打赏
  • 举报
回复
<%
contents="PFP_0P316_00"
startplace=1
for i=1 to 3
startplace=instr(startplace,contents,"p",1)
if startplace<>0 then
startplace=startplace+1
end if
next

contents=left(contents,startplace)+replace(contents,"P","D",startplace-1)
response.write contents
%>
zorou_fatal 2003-08-22
  • 打赏
  • 举报
回复
<%
contents="PFP_0P316_00"
startplace=1
for i=1 to 3
startplace=instr(startplace,contents,"p",1)
if startplace<>0 then
startplace=startplace+1
end if
next

contents=left(contents,startplace)+replace(contents,"P","D",startplace-1)
response.write contents
%>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧