replace String with another in java

前端 未结 6 1742
孤城傲影
孤城傲影 2020-11-22 08:14

What function can replace a string with another string?

Example #1: What will replace \"HelloBrother\" with \"Brother\"?

Example #2

6条回答
  •  太阳男子
    2020-11-22 08:57

         String s1 = "HelloSuresh";
         String m = s1.replace("Hello","");
         System.out.println(m);
    

提交回复
热议问题