Reference an object's name in a string?

So if I have an object and a string :

 public var mainName : String = "John";
 public var string = "";

I want to use the name in the string, I’ve tried this:

 string = mainName + "was walking down the street.";

But that doesn’t work, how can I do this?

I think its case sensitive. Your using stirng for a name, but string is a type. try using

public var String = "";

or

public var String : string;