You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2013/06/14 17:30:09 UTC
svn commit: r1493118 -
/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
Author: sebb
Date: Fri Jun 14 15:30:09 2013
New Revision: 1493118
URL: http://svn.apache.org/r1493118
Log:
Clarify Javadoc
Modified:
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1493118&r1=1493117&r2=1493118&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Fri Jun 14 15:30:09 2013
@@ -1061,7 +1061,10 @@ public class StringUtils {
*
* <p>A {@code null} or empty ("") CharSequence will return {@code -1}.
* A negative start position returns {@code -1}.
- * A start position greater than the string length searches the whole string.</p>
+ * A start position greater than the string length searches the whole string.
+ * The search starts at the startPos and works backwards; matches starting after the start
+ * position are ignored.
+ * </p>
*
* <pre>
* StringUtils.lastIndexOf(null, *, *) = -1
@@ -1164,7 +1167,10 @@ public class StringUtils {
* <p>A {@code null} CharSequence will return {@code -1}.
* A negative start position returns {@code -1}.
* An empty ("") search CharSequence always matches unless the start position is negative.
- * A start position greater than the string length searches the whole string.</p>
+ * A start position greater than the string length searches the whole string.
+ * The search starts at the startPos and works backwards; matches starting after the start
+ * position are ignored.
+ * </p>
*
* <pre>
* StringUtils.lastIndexOf(null, *, *) = -1
@@ -1176,6 +1182,10 @@ public class StringUtils {
* StringUtils.lastIndexOf("aabaabaa", "b", -1) = -1
* StringUtils.lastIndexOf("aabaabaa", "a", 0) = 0
* StringUtils.lastIndexOf("aabaabaa", "b", 0) = -1
+ * StringUtils.lastIndexOf("aabaabaa", "b", 1) = -1
+ * StringUtils.lastIndexOf("aabaabaa", "b", 2) = 2
+ * StringUtils.lastIndexOf("aabaabaa", "ba", 2) = -1
+ * StringUtils.lastIndexOf("aabaabaa", "ba", 2) = 2
* </pre>
*
* @param seq the CharSequence to check, may be null
@@ -1230,7 +1240,10 @@ public class StringUtils {
* <p>A {@code null} CharSequence will return {@code -1}.
* A negative start position returns {@code -1}.
* An empty ("") search CharSequence always matches unless the start position is negative.
- * A start position greater than the string length searches the whole string.</p>
+ * A start position greater than the string length searches the whole string.
+ * The search starts at the startPos and works backwards; matches starting after the start
+ * position are ignored.
+ * </p>
*
* <pre>
* StringUtils.lastIndexOfIgnoreCase(null, *, *) = -1