Using ASP to realize the transformation between the whole angle and the half angle

Source: Internet
Author: User
Tags chr end
In the case of an array that accepts a form, it is mostly separated by | or. However "," "," the whole horn is different from the half-width, and today we are going to explain how to convert it

<%
Function DBC2SBC (STR, flag)

REM Full-angle half-angle conversion function

In rem flag=-1, half angle and full angle

In rem flag=0, half angle and full angle are transferred

Full angle and half angle in rem flag=1


Dim I, SSTR
If Len (STR) <= 0 Then Exit Function
DBC2SBC = ""
For i = 1 to Len (STR)
SSTR = ASC (Mid (STR, I, 1))
Select Case Flag
Case-1
If sstr>0 and sstr<= Then
DBC2SBC = DBC2SBC & Chr (ASC (Mid (STR, I, 1))-23680
Else
DBC2SBC = DBC2SBC & Mid (STR, I, 1)
End If
Case 0
If sstr>0 and sstr<= Then
DBC2SBC = DBC2SBC & Chr (ASC (Mid (STR, I, 1))-23680
Else
DBC2SBC = DBC2SBC & Chr (ASC (Mid (STR, I, 1)) + 23680)
End If
Case 1
If sstr<0 Or sstr>125 Then
DBC2SBC = DBC2SBC & Chr (ASC (Mid (STR, I, 1)) + 23680)
Else
DBC2SBC = DBC2SBC & Mid (STR, I, 1)
End If
End Select
Next
End Function
%>



Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.