Java trim() 方法
Java 教程
· 2019-02-09 08:26:43
trim() 方法用于删除字符串的头尾空白符。
语法
public String trim()
参数
无
返回值
删除头尾空白符的字符串。
实例
public class Test {
public static void main(String args[]) {
String Str = new String(" www.codercto.com ");
System.out.print("原始值 :" );
System.out.println( Str );
System.out.print("删除头尾空白 :" );
System.out.println( Str.trim() );
}
}
以上程序执行结果为:
原始值 : www.codercto.com 删除头尾空白 :www.codercto.com
点击查看所有 Java 教程 文章: https://codercto.com/courses/l/12.html
Pattern Recognition and Machine Learning
Christopher Bishop / Springer / 2007-10-1 / USD 94.95
The dramatic growth in practical applications for machine learning over the last ten years has been accompanied by many important developments in the underlying algorithms and techniques. For example,......一起来看看 《Pattern Recognition and Machine Learning》 这本书的介绍吧!