package com.juick.util; /** * Created by aalexeev on 11/13/16. */ public class MessageUtils { private MessageUtils() { throw new IllegalStateException(); } public static String formatQuote(final String quote) { String result = quote; if (quote != null) { if (quote.length() > 50) { result = ">" + quote.substring(0, 47).replace('\n', ' ') + "...\n"; } else if (!quote.isEmpty()) { result = ">" + quote.replace('\n', ' ') + "\n"; } } return result; } }