wiley_pastebin

Lesson 4 string method 2

Mar 15th, 2019
2,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.24 KB | None | 0 0
  1. public class TestingStrings {
  2.  
  3.  public static void main(String[] args){
  4.   String example = "Test String";
  5.  
  6.  // Replace the word Test with Another
  7.  example = example.replace("Test", "Another");
  8.  
  9.   System.out.println(example);
  10.  }
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment