MCPcopy Create free account
hub / github.com/M66B/FairEmail / truncate

Method truncate

app/src/main/java/eu/faircode/email/HtmlHelper.java:2988–2997  ·  view source on GitHub ↗
(String text, int at)

Source from the content-addressed store, hash-verified

2986 }
2987
2988 static String truncate(String text, int at) {
2989 if (text.length() < at)
2990 return text;
2991
2992 String preview = text.substring(0, at);
2993 int space = preview.lastIndexOf(' ');
2994 if (space > 0)
2995 preview = preview.substring(0, space + 1);
2996 return preview + "…";
2997 }
2998
2999 @NonNull
3000 static String getText(Context context, String html) {

Callers 10

processMessageMethod · 0.95
sanitizeMethod · 0.95
getPreviewMethod · 0.95
_getTextMethod · 0.95
getTextMethod · 0.95
onExecuteMethod · 0.95
onExecuteMethod · 0.95
getSummaryTextMethod · 0.95
onExecuteMethod · 0.95
runMethod · 0.95

Calls 4

iMethod · 0.95
bodyMethod · 0.80
lengthMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected