Skip to content
⌘ NSIS Forum Archive

Looking for a String function

6 posts

Joel#

Looking for a String function

Is there a String function that read within it...?
Fo example:
If I have this string "Installer"
I wanna display only the string "sta" from that String...
Lilla#
Appendix B has function StrStr which allows you to test if 'sta' is a substring of 'Installer'.

I'm not clear on what you want, but thought I would offer this, just in case it fits.

Lilla
Afrow UK#
Push "Installer"
Push "sta"
Call StrStr
Pop $0
StrCmp $0 "" +2 +6

Using StrStr (off NSIS documentation) the output will be "" if "sta" was not found within it. Otherwise, the output will be "staller".
I have used StrStr a LOT throughout my NSIS aps.

There are a lot of good functions in there (some ones off NSIS archive)

-Stu
kichik#
And if, as I understand, you just want to copy 3 characters from the third letter in a string use:

StrCpy $0 "installer" 3 3