Is there a way to combine the users input from two text input boxes into one. My script is taking the input from both input boxes individually and comparing them to a string with answers set in the inspector. When the user answer matches the inspector set answer, the users score increases and the game moves on. So to make it clearer:
User input box one: Black
User input box two: Cat
The script is looking for Black Cat.
Can I combine the two words into one so that the script will match it as the right answer and move on to the next question?
I need the two inputs since the inputs are in different parts of the screen for my game to work. If I didn’t need separate inputs, I would just combine into one and have the user type Black Cat.
so basic string concatenation?
string answer = inputBoxA.text + " " + inputBoxB.text;
Just keep in mind spaces can change the input. If I type Black and for some reason add 3 spaces after, the answers will not match. You may need to consider trimming. Also don’t forget matching caps as well. black cat and Black Cat don’t match.
You may have already been aware of these things, but just in case. 
Otherwise, @LeftyRighty has the right answer
@Brathnann
I just looked at my code and realized that I am splitting my string up and comparing them individually to the currentQA.answers. how would I take the multiple inputs and add them together. When I try the above example and add in:
string[ ] userAnswers = userInputField.text.Split(‘,’) + userInputField2.text.Split(‘,’);
it gives me an error
error CS0019: Operator ‘+’ cannot be applied to operands of type ‘string[ ]’ and ‘string[ ]’
I think I understand what it is telling me, but not sure how to over come it and get a working result like @LeftyRighty has shown.
Right now I have:
public void Submit()
{
string[] userAnswers = userInputField.text.Split(',');
bool correct = false;
// if any of their answers matches one in the question/answer set, it's correct
foreach(string userAnswer in userAnswers)
{
if (currentQA.answers.Contains (userAnswer))
{
correct = true;
Debug.Log (userAnswer);
print ("User answer: '" + userAnswer + "' is correct!");
answerresulttext.text = "'" + userAnswer + "' is correct!";
tabletInterface.SetActive (false);
scoreAccess.AddScore (scoreValue);
scoreAccess.AddButtonCount (buttonCount);
break;
}
else
{
Debug.Log (userAnswer);
answerresulttext.text = "'" + userAnswer + "' is incorrect! The correct answer is: '" + currentQA.answers [0] + "'";
//tabletInterface.SetActive (false);
//scoreAccess.AddButtonCount (buttonCount);
print ("User answer: '" + userAnswer + "' is incorrect! The correct answer is: '" + currentQA.answers[0] + /*"," + currentQA.answers[1] + */"'");
}
}
}
@LeftyRighty @Brathnann
I figured it out. It was the way I was putting it in.
string[] userAnswers = (userInputField.text + userInputField2.text).Split(',');
This works. Thanks