mengdiwang / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Strings.lenientSubstring() #503

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please add a Strings.substring() method similar to

http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/StringUtils.html#
substring(java.lang.String, int, int)

Original issue reported on code.google.com by marius.a...@gmail.com on 23 Dec 2010 at 2:37

GoogleCodeExporter commented 9 years ago
PS: I'm not using apache commons as it's not supported in GWT

Original comment by marius.a...@gmail.com on 23 Dec 2010 at 2:37

GoogleCodeExporter commented 9 years ago
The URL is not escaped and hence incomplete. Here is a working version:

http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/StringUtils.html#
substring%28java.lang.String%2C%20int%2C%20int%29

Original comment by SeanPFl...@googlemail.com on 27 Dec 2010 at 6:08

GoogleCodeExporter commented 9 years ago
This was proposed internally a few years ago.  If implemented, it would be 
called Strings.lenientSubstring().  However, we are generally predisposed 
against the "forgiving" style of API (a very brief post by Guava team member 
Jesse: http://publicobject.com/2008/06/strict-vs-forgiving-apis.html), and we 
have not found a lot of evidence that there is a strong user need for this.

Original comment by kevinb@google.com on 12 Jan 2011 at 9:53

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 13 Jul 2011 at 6:18

GoogleCodeExporter commented 9 years ago

Original comment by fry@google.com on 10 Dec 2011 at 3:59

GoogleCodeExporter commented 9 years ago
I still agree with the me of a year ago.  Closing for now unless a 
preponderance of supporting evidence emerges.

Original comment by kevinb@google.com on 16 Feb 2012 at 7:04

GoogleCodeExporter commented 9 years ago
Proposed Issue 1124 to support just the negative indexes from the end of a 
string without the leniency.

Original comment by ddlat...@gmail.com on 28 Aug 2012 at 11:44

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:09