This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes replacing blank space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "replacing blank space" Watch "replacing blank space" New topic
Author

replacing blank space

kevin schmidt
Ranch Hand

Joined: Aug 24, 2001
Posts: 85
Hi,
I have a program that raeds in words, either one or two words. Now, If the program reads in two words, there is a space separating the words. How do I replace the space with and underscore?
before - Meeting Organizer
after - Meeting_Organizer
TIA.
kevin
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
after = before.replace(' ', '_');
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: replacing blank space
 
Similar Threads
Looks smaller in Unix ?
StringTokenizer
String Tokenizer
Printing arrays of ints
PriorityQueue Question