• Post Reply Bookmark Topic Watch Topic
  • New Topic

replacing blank space

 
kevin schmidt
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after = before.replace(' ', '_');
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!