Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 10355 invoked from network); 13 Nov 2007 03:21:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2007 03:21:12 -0000 Received: (qmail 33328 invoked by uid 500); 13 Nov 2007 03:20:59 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 33277 invoked by uid 500); 13 Nov 2007 03:20:59 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 33268 invoked by uid 99); 13 Nov 2007 03:20:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Nov 2007 19:20:59 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2007 03:21:10 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 96E8D71420B for ; Mon, 12 Nov 2007 19:20:50 -0800 (PST) Message-ID: <11277080.1194924050585.JavaMail.jira@brutus> Date: Mon, 12 Nov 2007 19:20:50 -0800 (PST) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (LANG-269) Shouldn't Commons Lang's StringUtils have a "common" string method? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542038 ] Henri Yandell commented on LANG-269: ------------------------------------ svn ci -m "Applying Scott Johnson's great work in LANG-269" src Sending src/java/org/apache/commons/lang/StringUtils.java Sending src/test/org/apache/commons/lang/StringUtilsTest.java Transmitting file data .. Committed revision 594409. Slight modification to the patch in that I removed a Math.max from the loop by starting at 0 and not -1 for the smallest value. > Shouldn't Commons Lang's StringUtils have a "common" string method? > ------------------------------------------------------------------- > > Key: LANG-269 > URL: https://issues.apache.org/jira/browse/LANG-269 > Project: Commons Lang > Issue Type: New Feature > Environment: generic > Reporter: Michael Dang > Fix For: 2.4 > > Attachments: StringUtils.patch, v2_StringUtils.java.patch, v2_StringUtilsTest.java.patch > > > A method which accepts a string array and returns a string which is the common portion of all the strings starting from the left, or more general form of that. > This is very common operation. For example, one may want to find the common directory of a set of path strings. > passing in: > "/foo/f1.txt" > "/foo/moo/f2.txt" > "/foo/moo/f3.txt" > should returns "/foo/" > It is tedious to implement this in every project. And I think Commons Lang StringUtils should have some methods to help in this. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.