String replace() and replaceAll() modify

来源:互联网 发布:南京魔苹网络能去吗 编辑:程序博客网 时间:2024/06/06 07:21

1.the parameters of replace are char and CharSequence,which can support this substribution of characters,and also support the substribution of strings ;


2.the parameters of replaceAll is the regex,which is based on the substribution of the rule expression,for example ,all numeric characters of a string can be replaced by the asterisk by replaceAll("\ \ ","*"); 


3.tips: in java "//"=="/",in regex "//"=="/" so when in java and regex "////"=="/"

原创粉丝点击