且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java String.trim()会删除多少个空格?

更新时间:2023-12-03 18:54:34

所有这些

返回
删除前导和尾随空格的此字符串的副本,如果没有前导或尾随空格,则为此字符串。

Returns: A copy of this string with leading and trailing white space removed, or this string if it has no leading or trailing white space.


〜引自Java 1.5.0 docs

~ Quoted from Java 1.5.0 docs


(但你为什么不试试看自己呢?)