您正在使用 IPV4 [3.236.145.153] 访问本站,您本次已经查看了 1 页
用户名: 密 码: 验证码:     用QQ登录本站
首页 软件 编程 笑话 知识 公告 台风 日历 计算器
[公益]保护绿色环境,构建和谐社会       悟空收录网      

【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中      
[公益] 地球是我家,绿化靠大家      
2024年 妇女节 010
2024年 清明节 037
2025年 元 旦 309
2025年 春 节 337
 
您现在的位置:首页 >> ASP/ASP.net >> 内容
本类新增
本类热门
asp将全角的字符转变成半角字符,将半角转变成全角d的代码
内容摘要: 将全角的字符转变成半角字符,将半角转变成全角%FunctionDSConvert(vString,vFlag)RemvFlag为0时表示从全角转为半角,为其他时表示从半角转为全角Dimi,tmpSingleCharaASC,TempResult,SAscString,DAscStringSAscString='1,2,3,4,5,6,7,8,14,15,16......
将全角的字符转变成半角字符,将半角转变成全角

<%

FunctionDSConvert(vString,vFlag)

RemvFlag为0时表示从全角转为半角,为其他时表示从半角转为全角

Dimi,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,125,126"

DAscString="-23679,-23678,-23677,-23676,-23675,-23674,-23673,-23672,-23666,-23665,-23664,-23663,-23662,-23661,-23660,-23659,-23658,-23657,-23656,-23655,-23654,-23653,-23647,-23646,-23645,-23644,-23643,-23642,-23641,-23640,-23639,-23638,-23637,-23636,-23635,-23634,-23633,-23632,-23631,-23630,-23629,-23628,-23627,-23626,-23625,-23624,-23623,-23622,-23621,-23620,-23619,-23618,-23617,-23616,-23615,-23614,-23613,-23612,-23611,-23610,-23609,-23608,-23607,-23606,-23605,-23604,-23603,-23602,-23601,-23600,-23599,-23598,-23597,-23596,-23595,-23594,-23593,-23592,-23591,-23590,-23589,-23588,-23587,-23586,-23585,-23584,-23583,-23582,-23581,-23580,-23579,-23578,-23577,-23576,-23575,-23574,-23573,-23572,-23571,-23570,-23569,-23568,-23567,-23566,-23565,-23564,-23563,-23562,-23561,-23560,-23559,-23558,-23557,-23556,-23555,-23554"

TempResult=""

IfLen(vString)<=0ThenResponse.Write"ParametersError!PleaseCheckYourParameters!":Response.End:ExitFunction

Fori=1toLen(vString)

tmpSingleCharaASC=Asc(Mid(vString,i,1))

IfvFlag=0Then

IfInStr(DAscString,tmpSingleCharaASC)<>0andlen(Cstr(tmpSingleCharaASC))=6Then

TempResult=TempResult&Chr(tmpSingleCharaASC+23680)

Else

TempResult=TempResult&Chr(tmpSingleCharaASC)

EndIf

Else

IfInStr(SAscString,tmpSingleCharaASC)<>0andLen(Cstr(tmpSingleCharaASC))<=4Then

TempResult=TempResult&Chr(tmpSingleCharaASC-23680)

Else

TempResult=TempResult&Chr(tmpSingleCharaASC)

EndIf

EndIf

Next

DSConvert=TempResult

EndFunction

%>

全角转半角

<%=DSConvert("1234566465454",0)%>

半角转全角

<%=DSConvert("1234567890132131",1)%>

版权声明:本内容来源于网络,如有侵犯您的版权,请联系站长,本站收到您的信息后将及时处理。
上一篇:asp 在线备份与恢复sqlserver数据库的代码

 

下一篇:Asp 返回引用类型函数代码

发布日期:2024/1/23
手机扫二维码直达本页
发布时间:12:08:03
点  击:40
录  入:伊伊
相关文章
Baidu
YiJiaCMS 7.3.8 build231228(MSSQL) 闽ICP备05000814号-1
本空间由腾讯云(轻量应用服务器)提供,Cloudflare提供加速防护
运行时间载入中.....