How do I concatenate 2 strings in NSIS?
Asked
Active
Viewed 2.3k times
4 Answers
19
If you want to concatenate using the same variable you can do something like this:
StrCpy $1 "ABC"
StrCpy $1 "$1123"
DetailPrint $1
output is "ABC123"

Benoit Garret
- 14,027
- 4
- 59
- 64

ehambright
- 1,416
- 19
- 27
-
4+1 for mentioning that the variables can be placed just next to string literals – Jaime Hablutzel Mar 20 '14 at 03:33
14
StrCpy $1 "Hello"
StrCpy $2 "World"
StrCpy $3 "$1 $2"
DetailPrint $3

Benoit Garret
- 14,027
- 4
- 59
- 64

diego2k
- 593
- 2
- 4
- 15
0
If you're looking to split up one long string over multiple lines, just use the \
inside the quotes:
MessageBox MB_OK "Alright, Mr. User you are done here, so you can go ahead and \
stop reading this message box about now."

Brad Turek
- 2,472
- 3
- 30
- 56