取一个字符串的前20个字符,保证不越界 Leave a Comment / Java / August 20, 2008 August 20, 2008 content.substring(0, Math.min(content.length(), 20))