Skip to content

Commit

Permalink
Update replace-in-string.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hollischuang authored Jun 10, 2021
1 parent 5b54c2e commit 32087bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/basics/java-basic/replace-in-string.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ replaceAll和replaceFirst的区别主要是替换的内容不同,replaceAll是

//使用replaceFirst将第一个数字替换成H
System.out.println(string.replaceFirst("\\d","H"));//abcH23adb23456aa
//使用replaceFirst将所有数字替换成H
System.out.println(string.replaceAll("\\d","H"));//abcHHHadbHHHHHaa
//使用replaceAll将所有数字替换成H
System.out.println(string.replaceAll("\\d","H"));//abcHHHadbHHHHHaa

0 comments on commit 32087bb

Please sign in to comment.