asp 将数字135487986546转化为135,487,986,546 不用fn函数

来源:百度知道 编辑:UC知道 时间:2024/06/19 19:46:40

<%
oldstr = "135487986546"
newstr = ""
for n=1 to len(oldstr) step 3
if n = 1 then
newstr = mid(oldstr,n,3)
else
newstr = newstr & "," & mid(oldstr,n,3)
end if
next
response.Write newstr
%>

<%
oldstr = "135487986546"
newstr = ""
for n=1 to len(oldstr) step 3
if n = 1 then
newstr = mid(oldstr,n,3)
else
newstr = newstr & "," & mid(oldstr,n,3)
end if
next
response.Write newstr
%>
用替换函数
Replace(expression, find, replacewith[, compare[, count[, start]]])

用替换函数就行了,语法如下:
语法
Replace(expression, find, replacewith[, compare[, count[, start]]])

用替换函数就行了,语法如下:
语法
Replace(expression, find, replacewith[, compare[, count[, start]]])