Android. Replace * character from String

后端 未结 3 868
时光取名叫无心
时光取名叫无心 2021-01-04 04:07

I have a String variable that contains \'*\' in it. But Before using it I have to replace all this character.

I\'ve tried replaceAll function but without success:

3条回答
  •  礼貌的吻别
    2021-01-04 04:33

    Try this.

    You need to escape the * for the regular expression, using .

    text = text.replaceAll("\\*","");
    

提交回复
热议问题