NSIS检测并统计字符串中某个字符个数
!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
本文来自博客园,作者:水晶石,转载请注明原文链接:https://www.cnblogs.com/NSIS/p/16581136.html