去除字串中的汉字

!include "LogicLib.nsh"
XPStyle on
!include "WordFunc.nsh"
#去除字串中的汉字
#本例仅是个思路,测试环境和给出的条件有限,如有异常,有进一步修改的余地。
OutFile "NSIStest.exe"
Name "test"
Section "test"
StrCpy $0 "测试x电影y下载2欢迎你5来了" ;测试用字串
StrLen $1 $0
StrCpy $2 ''
ReadRegStr $R2 HKLM "SOFTWAREMicrosoftWindows NTCurrentVersion" "CurrentVersion"
${Select} $R2
 ${Case4} "4.9" "5.0" "5.1" "5.2"
 ${Do}
 IntOp $1 $1 - 1
 ${IfThen} $1 = -1 ${|}${ExitDo}${|}
 StrCpy $3 $0 1 $1
 ${if} $3 != ''
 StrCpy $2 '$3$2'
 ${endif}
${Loop}
MessageBox MB_OK '$2'
 ${Case2} "6.0" "6.1"
 #摘取字串中的数字和字母,实际运用中含有符号或其他特别字符自行修改StrFilter的参数
 ${StrFilter} "$0" "12" "" "" $R0
 MessageBox MB_OK '$R0'
${EndSelect}
SectionEnd
© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容