replace a string in a string

The replace method and replaceAll method in the String class both replace all matched strings, but the parameters are different. The difference is that the first parameter of replaceAll is a regular expression

To replace a string, use StringBuffer or StringBuilder's replace(int start, int end, String str) to replace the str string at the specified position

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326057062&siteId=291194637