28,405
社区成员
发帖
与我相关
我的任务
分享'***********************************************
'去掉尺寸后面的数量
'***********************************************
Function Dimensions(num)
dim idArr,idArr2,y,yy,i
if instr(num,",")>0 then
idArr=split(num,",")
for yy = 0 to ubound(idArr)
idArr2=split(idarr(yy),"X")
for y= 0 to ubound(idArr2)
y=y+1
if y>3 then
Exit For
end if
if y=1 and yy=0 then
Dimensions=idarr2(y-1)
elseif y=1 and yy<>0 then
Dimensions=Dimensions&","&idarr2(y-1)
else
Dimensions=Dimensions&"X"&idarr2(y-1)
end if
'Response.Write num
next
next
else
Dimensions=num
end if
End Function
<%
Response.Write Dimensions("56X54.5X85X2,38X38X76")
Function Dimensions(num)
Dim a, b
a = Split(num, ",")
s = ""
For i=0 To UBound(a)
b = Split(a(i), "X")
If UBound(b) > 2 Then
t = ""
For j=0 To 2
t = t & b(j) & "X"
Next
t = Left(t, Len(t)-1)
s = s & t & "<span style='color:red;'>" & Right(a(i),Len(a(i))-Len(t)) & "</span>,"
Else
s = s & a(i) & ","
End If
Next
If s <> "" Then s=Left(s,Len(s)-1)
Dimensions = s
End Function
%>
Function Dimensions(num)
Dim a, b
a = Split(num, ",")
s = ""
For i=0 To UBound(a)
b = Split(a(i), "X")
If UBound(b) > 2 Then
t = ""
For j=0 To 2
t = t & b(j) & "X"
Next
t = Left(t, Len(t)-1)
s = s & t & ","
Else
s = s & a(i) & ","
End If
Next
If s <> "" Then s=Left(s,Len(s)-1)
Dimensions = s
End Function