NOTA: La traducción de esta documentación es un esfuerzo personal y voluntario, no es un documento oficial de Sun Microsystems ni Oracle ni está patrocinado por ninguna de estas empresas. Los documentos originales (en inglés) están disponibles en: http://java.sun.com/docs/books/tutorial/.
Dirija cualquier comentario, petición, felicitación, etc. a tutorialesjava_@RROBA_codexion.com.
Si desea ayudar a mantener en funcionamiento esta web, colaborar con la traducción de estos documentos o necesita que se traduzca algĂșn capĂ­tulo en concreto puede realizar una donación directa mediante Paypal:
Sentence Boundaries (The Java™ Tutorials > Internationalization > Working with Text)
Trail: Internationalization
Lesson: Working with Text
Section: Detecting Text Boundaries
Sentence Boundaries
Home Page > Internationalization > Working with Text
Sentence Boundaries
You can use a BreakIterator to determine sentence boundaries. You start by creating a BreakIterator with the getSentenceInstance method:
BreakIterator sentenceIterator = BreakIterator.getSentenceInstance(currentLocale);

To show the sentence boundaries, the program uses the markBoundaries method, which is discussed in the section Word Boundaries. The markBoundaries method prints carets (^) beneath a string to indicate boundary positions. Here are some examples:

She stopped.  She said, "Hello there," and then went on.
^             ^                                         ^

He's vanished!  What will we do?  It's up to us.
^               ^                 ^             ^

Please add 1.5 liters to the tank.
^                                 ^
Previous page: Word Boundaries
Next page: Line Boundaries