Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes help with programing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help with programing" Watch "help with programing" New topic

help with programing

rick dog

Joined: Mar 12, 2010
Posts: 1
I am trying to put spaces in a string where 123456 would become 1 2 3 4 5 6
Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149

well, depends on how those numbers are provided....

I basically can think of two ways doing it:

hope that helps
Henry Wong

Joined: Sep 28, 2004
Posts: 20521

I am assuming that this is a homework problem, so... what have you done so far? and what issues have you run into?


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149

Sorry Rick, you said String. I didn't read carefully enough.
What about a loop and charAt() ?

I sure do have a solution for that.

So, is it homework?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10824

rick dog wrote:

Please check your private messages for an important administrative matter

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46349
You should always use a thread subject which tells us what your question is.
I agree. Here's the link:
subject: help with programing
It's not a secret anymore!