且构网

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

如何从字符串的开头和结尾删除换行符?

更新时间:2023-01-22 19:33:18

使用

Use String.trim() method to get rid of whitespaces (spaces, new lines etc.) from the beginning and end of the string.

String trimmedString = myString.trim();