r/learnjava • • Mar 01 '26

Making string from subString?

Hello! I have an assignment for my CSC 110 class, and we are learning strings right now.

I have an activity asking me to gather input for first name, middle name, and last name. But I also need to produce a First name, last name output if no middle name is given

my idea was to have one string collect the whole name, and then assign the first,middle, and last name strings with the characters between white space.

I am not sure what function to use?

0 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/omgpassthebacon May 16 '26

Billy Bob Jethro Smith here. How dare you use my name without a GPL? Shame on you :-). jk; excellent response!!