I have a variable inside of a String. Now I need to take that Variable from the string and split it so it only take that part and store it in a new variable so I can print just that variable. (I'm sorry if its a rough explanation I'm new and phrasing things is still tricky)
fisrtName is the users input
String FIRST_SENTENCE = " There once was a person named " + firstName + " who lived in a city called " + city + ". ";
//there are other strings and variables but this is basically the important part
String nameOne = FIRST_SENTENCE.split(firstName);
System.out.println(nameOne);
All I need is for the println to output (firstName) aka (userInput)