Jon Johnston

Greenhorn
+ Follow
since Sep 03, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jon Johnston

Hi All,

Sorry for my delayed response.

Well I was close to figuring it out but I lost the file I was working on and so I'm back to square one. When I was originally working on it I had a For loop but the output was printing stuff out vertically and I don't think the problem was meant to have a For loop used. And while normally I would be fine using any method to solve the problem, I want to solve the problem using a more basic string method since I am following an online course, hopefully that makes sense =).

And I know in my mind I am making this more complicated than it needs to be but I find myself getting frustrated cause I can't figure it out lol. Ok so I'm going to trying and talk about how I would solve this (and I really liked "Not a Code Mill" thing).

Well first I need to have some sort of .split method and I'm pretty sure " fullName.spilt(""); " should work. But its the second part I really can't figure out, how to get the first name and last name to be printed out. I checked out the String Doc from oracle but I'm not sure which method to use to achieve this. Do I use a .substring or .length? And I tried both but with no luck.
9 years ago
All the code you see was already written as part of the problem. I can't just put a name in because when running the code it has to be able to split whatever name you put in.
And thank you, yes it looks much better! =D
9 years ago
Hi All,

I am new to Java and I'm currently using a site called Programmr to practice. Anyways there is a problem that I had tried to solve for 4 hours today and I can't seem to nail it down. I know I am close but any help would be great!

"A String variable, fullName, contains a name in the following format:
first name last name (single blank)

Extract the first name into the String variable firstName and the last name into the String variable lastName.
Assume the variables have been declared and fullName already initialized. You may also declare any other necessary variables. "



9 years ago