concat() v.s. replace() v.s. trim()
concat()
The concat() method of the String class appends one String to the end of another. The method returns a String with the value of the String passed into the method, appended to the end of the String, used to invoke this method.
在指定字串,增加新字串
replace()
This replace() method of the String class returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
將指定字串,取代為新字串
trim()
This trim() method of the String class returns a copy of the string, with leading and trailing whitespace omitted.
去除指定字串的首尾空白
英文內容轉載自:concat(), replace(), and trim() Strings in Java.