Program To Replace Characters In A String in Java

LEVEL: Beginner

Whats in this post?

  1. Code
  2. Output
  3. Background and Explanation of the code

Code


To copy code: Click  View Source “View Source” on the right of this code snippet.

Background and Explanation of the code


A simple program which replaces specific char with one of our choice.
This program transforms the string “To be or not to be, that is the question”  in a way that it replaces the free space with a “/”.