Skip to content

Instantly share code, notes, and snippets.

@taka2
Created March 3, 2011 09:12
Show Gist options
  • Select an option

  • Save taka2/852541 to your computer and use it in GitHub Desktop.

Select an option

Save taka2/852541 to your computer and use it in GitHub Desktop.
import java.text.BreakIterator;
public class test
{
public static void main(String[] args) throws Exception
{
BreakIterator bi = BreakIterator.getLineInstance();
bi.setText("first line.\nsecond line.\nthird line.");
bi.following(36);
//bi.preceding(36);
}
}
/*
Exception in thread "main" java.lang.IllegalArgumentException: offset out of bounds
at java.text.RuleBasedBreakIterator.checkOffset(RuleBasedBreakIterator.java:724)
at java.text.RuleBasedBreakIterator.following(RuleBasedBreakIterator.java:737)
at test.main(test.java:9)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment