Get a list to display all strings

Hello, I need a list of type string to be able to print all the characters in contains into one word.

public List<string> input;

if(Input.inputString!=null)
		{
			input.Add(Input.inputString);
		}

So in this example everytime a string is entered it it saved to the list. Now Once I am ready I need to be able to print the strings together.

e.g. user enters the strings “bannana”, “carrots” and “potatoes” into the list.

I would like to have code that prints the contents of the list i.e “bannanacarrotspotatoes”

Any ideas?

Thanks

Do you need to save all the string pieces? Most of the time inputString will be empty or only contain a single letter. That is inputString only contains the characters typed during last frame, so it will never be “bananas”. You can collect the whole string more simply with:

public string input = "";  

if (Input.inputString != null)
  input += Input.inputString;

Then ‘input’ will be the whole string put together.