Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 59098 invoked from network); 4 May 2004 20:55:56 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 May 2004 20:55:56 -0000 Received: (qmail 69581 invoked by uid 500); 4 May 2004 20:55:33 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 69544 invoked by uid 500); 4 May 2004 20:55:33 -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 69434 invoked from network); 4 May 2004 20:55:32 -0000 Received: from unknown (HELO sd-eng-srv3.SD.cardionet.com) (12.22.207.132) by daedalus.apache.org with SMTP; 4 May 2004 20:55:32 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4321A.275F883C" Subject: RE: [lang] StringUtils.strip Date: Tue, 4 May 2004 13:55:38 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [lang] StringUtils.strip Thread-Index: AcQyGVIr+0H0z5fQQi2uoK2L9LT92QAAHKAQ From: "Charles Hudak" To: "Jakarta Commons Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C4321A.275F883C Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The javadoc explicitly says: "Strips any of a set of characters from the start and end of a String. This is similar to String.trim() but allows the characters to be stripped to be controlled" Your characters are neither at the start or end of the string, hence nothing happens. You probably want to do this: StringUtils.replace(number, "-", ""); -----Original Message----- From: Mike Zatko [mailto:mzatko@boscovs.com ] Sent: Tuesday, May 04, 2004 1:50 PM To: Jakarta Commons Users List Subject: [lang] StringUtils.strip I have a problem with the strip method: String number =3D "610-926-6598"; String newNumber =3D StringUtils.strip(number, "-"); System.out.println("newNumber: '" + newNumber + "'"); Output: newNumber: '610-926-6598' According to the JavaDoc, this should strip out the hyphens but it does not. A matter of fact I cannot get it to strip anything. http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/Strin gUtils.html#strip(java.lang.String,%20java.lang.String ) -- Michael H. Zatko WebSphere Developer Boscov's Information Services Work: 610-929-7317 Home: 610-562-2407 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org ------_=_NextPart_001_01C4321A.275F883C--