检测并统计字符串中某个字符个数

!include "LogicLib.nsh"
OutFile "检查找字符串中c出现的次数.exe"
Name "test"
Section "test"
StrCpy $0 "cabcdccccc"
StrLen $1 $0
StrCpy $2 ''
loop:
IntOp $1 $1 - 1
StrCmp $1 "-1" end
StrCpy $3 $0 1 $1
${if} $3 == c
StrCpy $2 '$2$3'
${endif}
goto loop
end:
StrLen $4 $2
MessageBox MB_OK 'c出现$4次!'
SectionEnd
© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容