Reputation: 927
I'm trying to append two string to each other in squeak(version 4.5) and there is no success. For example(what i wish to do):
str1:='hello '.
str2:='world'.
appendStr:= str1 + str2.
There is a way to do that in squeak? (note: the + operator is not necessary- just example)
Thanks a lot, Nisan.
Upvotes: 3
Views: 1459
Reputation: 3110
It is possible, you need to use the #,
(comma) message like this:
| string1 string2 complete |
string1 := 'Hello '.
string2 := 'World!'.
complete := string1, string2.
Note that in Smalltalk, comma is no syntax but just another message.
Upvotes: 7