asp怎样将数字从左边每四个隔开

漠叔 2010-03-04 03:30:21
比如4587854465105464输出时要4587 8544 6510 5464 23
用asp如何实现?
...全文
70 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wcwtitxu 2010-03-04
  • 打赏
  • 举报
回复

Function section(ByVal s)
With New RegExp
.Pattern = "\d{4}(?=\d)"
.Global = True
section = .Replace(s, "$& ")
End With
End Function
ilyily121 2010-03-04
  • 打赏
  • 举报
回复
搞错。。我上面的 不行。。。。
漠叔 2010-03-04
  • 打赏
  • 举报
回复
各位最好能给个函数,因为有多处需要调用
Dogfish 2010-03-04
  • 打赏
  • 举报
回复
s="4587854465105464"
s2=""
for i=1 to len(s) step 4
if s2="" then
s2 = mid(s,i,4)
else
s2 = s2 & " " & mid(s,i,4)
end if
next
response.write s2
ilyily121 2010-03-04
  • 打赏
  • 举报
回复
源代码 加个 
wcwtitxu 2010-03-04
  • 打赏
  • 举报
回复

s = "4587854465105464"

With New RegExp
.Pattern = "\d{4}"
.Global = True
s = .Replace(s, "$& ")
End With

Response.Write s

28,390

社区成员

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

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