trim() 方法用于删除字符串的头尾空白符。

	public static void main(String[] args) {
                String str = new String("  https://blog.csdn.net/lihua5419  ");
	        System.out.print("博客地址 :" );
	        System.out.println( str );

	        System.out.print("删除头尾空白后地址 :" );
	        System.out.println( str.trim() );
	}

java中trim()

 

相关文章:

  • 2021-08-20
  • 2022-12-23
  • 2022-01-15
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
相关资源
相似解决方案