Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 33965 invoked from network); 19 Nov 2004 10:30:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 19 Nov 2004 10:30:43 -0000 Received: (qmail 67704 invoked by uid 500); 19 Nov 2004 10:30:36 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 67653 invoked by uid 500); 19 Nov 2004 10:30:36 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 67634 invoked by uid 99); 19 Nov 2004 10:30:35 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ha.ryon@gmail.com designates 64.233.170.205 as permitted sender) Received: from [64.233.170.205] (HELO rproxy.gmail.com) (64.233.170.205) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 19 Nov 2004 02:30:33 -0800 Received: by rproxy.gmail.com with SMTP id a36so19736rnf for ; Fri, 19 Nov 2004 02:30:28 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=Vn9OLpWdAjOL2rYoRbQwPgffSnUBdyVqATv1ATXPr9r57b0LCPx98wf/V8Lg/BYcI7pqpZfSzLjmgzhL56kt8C6nAc+yUcX9HhjYjmY1lSiX7Y8rl6Bc2rPPvQ3yMLAp4txujBD+ayTFNXnZVSLsURqadVjW0MAodFhb9I/f6HY= Received: by 10.38.79.36 with SMTP id c36mr118987rnb; Fri, 19 Nov 2004 02:30:28 -0800 (PST) Received: by 10.38.150.12 with HTTP; Fri, 19 Nov 2004 02:30:28 -0800 (PST) Message-ID: Date: Fri, 19 Nov 2004 11:30:28 +0100 From: Ha ryon Reply-To: Ha ryon To: commons-user@jakarta.apache.org Subject: [lang] Additions to StringUtils ? Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N - I would like to be able to split a string using a String (more than one character long) separator. split("John:Arthur::Renaud:Sylvan::me:you", "::") ->[ "John;Arthur", "Renaud:Sylvan", "me:you" ] - I would like to fastly join and quote at the same time : join(["me", "you", "them"], "|", "<", ">") -> "||" basically, I would usually use it to turn an array into some javascript or sql list : join( ["me", "you", "them"], ", ", "'", "'") -> "'me', 'you', 'them'" and then "select * from guys where name in (" + ... + ")". Idem with generating some javascript to a jsp. - then split such a quoted string back to an array. split("'me', 'you', 'them'", ", ", "'", "'") -> ["me", "you", "them"] (I know I can do all of this with regexp, or a bit of work, but the question is always can i do it with one line :) --- ** lazy !! **) --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org