How to split the string using '^' this special character in java?

后端 未结 3 935
北恋
北恋 2020-12-03 15:06

I want to split the following string \"Good^Evening\" i used split option it is not split the value. please help me.

This is what I\'ve been trying:



        
3条回答
  •  醉话见心
    2020-12-03 15:11

    try this

    String str = "Good^Evening";
    String newStr = str.replaceAll("[^]+", "");
    

提交回复
热议问题