ASP converts full-width characters to half-width characters, and transforms half-width to full angle D code _ Application Tips
Source: Internet
Author: User
Converts full-width characters into half-width characters, turning half corners to full angle
<%
Function Dsconvert (Vstring,vflag)
Rem Vflag is 0 when it converts from full angle to half angle, and for other expressions from half-width to full angle.
Dim i,tmpsinglecharaasc,tempresult,sascstring,dascstring
sascstring = " 1,2,3,4,5,6,7,8,14,15,16,17,18,19,20,21,22,23,24,25,26,27,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53 , 54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93 , 94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,12 5,126 "
Tempresult = ""
If Len (vstring) <= 0 Then Response.Write "Parameters error! Please Check Your parameters! ": Response.End:Exit Function
For I=1 to Len (vstring)
TMPSINGLECHARAASC = ASC (Mid (vstring,i,1))
If vflag = 0 Then
If InStr (DASCSTRING,TMPSINGLECHARAASC) <> 0 and Len (Cstr (TMPSINGLECHARAASC)) = 6 Then
Tempresult = Tempresult & Chr (tmpsinglecharaasc+23680)
Else
Tempresult = Tempresult & Chr (TMPSINGLECHARAASC)
End If
Else
If InStr (SASCSTRING,TMPSINGLECHARAASC) <> 0 and Len (Cstr (TMPSINGLECHARAASC)) <=4 Then
Tempresult = Tempresult & Chr (tmpSingleCharaASC-23680)
Else
Tempresult = Tempresult & Chr (TMPSINGLECHARAASC)
End If
End If
Next
Dsconvert = Tempresult
End Function
%>
Full angle Turn half angle
<%= Dsconvert ("1234566465454", 0)%>
Half angle turn whole angle
<%= Dsconvert ("1234567890132131", 1)%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.