您的位置:首页 > 其它

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

2012-11-05 18:01 1066 查看
!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


[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: