From 78c373d7bc23e81c82cac6feb66a9f6b9472f8ab Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Tue, 20 Sep 2016 19:46:50 +0200 Subject: [PATCH] LANG-1023 WordUtils.wrap: Customizable breakable characters (not just space/whitespace) updated JavaDoc --- .../apache/commons/lang3/text/WordUtils.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/text/WordUtils.java b/src/main/java/org/apache/commons/lang3/text/WordUtils.java index 9e04962d9..a85f28f62 100644 --- a/src/main/java/org/apache/commons/lang3/text/WordUtils.java +++ b/src/main/java/org/apache/commons/lang3/text/WordUtils.java @@ -177,7 +177,7 @@ public class WordUtils { } /** - *

Wraps a single line of text, identifying words by ' '.

+ *

Wraps a single line of text, identifying words by wrapOn.

* *

Leading spaces on a new line are stripped. * Trailing spaces are not stripped.

@@ -188,6 +188,7 @@ public class WordUtils { * wrapLenght * newLineString * wrapLongWords + * wrapOn * result * * @@ -195,6 +196,7 @@ public class WordUtils { * * * * * true/false + * * * null * * @@ -202,6 +204,7 @@ public class WordUtils { * * * * * true/false + * * * "" * * @@ -209,6 +212,7 @@ public class WordUtils { * 20 * "\n" * true/false + * " " * "Here is one line of\ntext that is going\nto be wrapped after\n20 columns." * * @@ -216,6 +220,7 @@ public class WordUtils { * 20 * "<br />" * true/false + * " " * "Here is one line of<br />text that is going<br />to be wrapped after<br />20 columns." * * @@ -223,6 +228,7 @@ public class WordUtils { * 20 * null * true/false + * " " * "Here is one line of" + systemNewLine + "text that is going" + systemNewLine + "to be wrapped after" + systemNewLine + "20 columns." * * @@ -230,6 +236,7 @@ public class WordUtils { * 20 * "\n" * false + * " " * "Click here to jump\nto the commons\nwebsite -\nhttp://commons.apache.org" * * @@ -237,10 +244,18 @@ public class WordUtils { * 20 * "\n" * true + * " " * "Click here to jump\nto the commons\nwebsite -\nhttp://commons.apach\ne.org" * + * + * "flammable/inflammable" + * 20 + * "\n" + * true + * "/" + * "flammable/inflammable" + * * - * * @param str the String to be word wrapped, may be null * @param wrapLength the column to wrap the words at, less than 1 is treated as 1 * @param newLineStr the string to insert for a new line,