我想获取电子邮件正文的前255个字符。就像在Outlook中一样,我们在左面板上看到的电子邮件列表显示为一行消息正文。我想预览电子邮件。
任何来自ews的内置api都比字符串操作好 谁能帮我一下。预先感谢
答案 0 :(得分:0)
我不确定我是否理解正确,但是如果您只想获取现有字符串的前255个字符,可以使用:
String message; //String that holds your message
String previewMessage = ""; //String to store your pewview message
if(message.length() >= 255) {
previewMessage = message.substring(0, 254);
}