Part 5/9 Concatenation
If you forget to put spaces at the end of your sentences, there is another way you can add spaces in between two strings. Check out the code below.
1 private var stringOne:String = "Hello, my name";
2 private var stringTwo:String = "is Gregory Carlson";
3 private var stringThree:String = stringOne + stringTwo;
Right now, stringThree will read:
Hello, my nameis Gregory Carlson.
Kind of annoying since there is no space between name and is. But watch what I do when I create stringFour:
4 private var stringFour:String = stringOne + " " + stringTwo ";
Is that third " supposed to be there?
private var stringFour:String = stringOne + " " + stringTwo ?"?;
Nope. It'll be fixed in the next update. Thanks.