Skip to content

Instantly share code, notes, and snippets.

@seebs
Created July 29, 2015 20:42
Show Gist options
  • Save seebs/52f33db5cd223c8cb5f2 to your computer and use it in GitHub Desktop.
Save seebs/52f33db5cd223c8cb5f2 to your computer and use it in GitHub Desktop.
int elements = root.getElementCount();
int excess = elements - maximumLines;
if (excess > 0) {
if (isRemoveFromStart) {
root.replace(0, excess, new Element[0]);
} else {
root.replace(elements - excess, excess, new Element[0]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment