Article View: borland.public.jbuilder.java.language
Article #7156Re: string substitution in java
From: CLG
Date: Thu, 05 Jul 2001 16:35
Date: Thu, 05 Jul 2001 16:35
47 lines
2105 bytes
2105 bytes
As for string substitution, you just have to create a new string since strings are immutable. Strings use the StringBuffer class for their hardcore work, and like I mentioned before, you might want to take a look at that class. See http://java.sun.com/j2se/1.3/docs/api/index.html -- Peace, Carl L. Gilbert http://www.rigidsoftware.com ICQ 614395-currently stolen working to retrieve. "Then said I, Wisdom [is] better than strength: nevertheless the poor man's wisdom [is] despised, and his words are not heard." Ecclesiastes 9:16 "WANG" <wangjian@online.sh.cn> wrote in message news:3b431d00_2@dnews... > first question: > Is there any way to substitute the string in java as like in c/c++ with > sprintf or in delphi with Format(s,OPENARRAY(TVarRec,..)). It's very usefull > to build the SQL statement in run time. > > second question: > With assignment of a long string I have to break it into several pieces and > use + to concatenate them > String s="select * from emp"+ > "where ....."; > Is there a way not to use + concatenation as like in delphi/CB > AnSistring s="select * from emp \ > where ......."; > > > > > > > > > >
Technical Details
Message-ID:
<3b449884$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!howland.erols.net!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b431d00_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,ba6e4791af4b2918 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-07-05 09:54:28 PST From: "CLG" <lamont_gilbert @ rigidsoftware.com> Newsgroups: borland.public.jbuilder.java.language References: <3b431d00_2@dnews> Subject: Re: string substitution in java Date: Thu, 5 Jul 2001 12:35:58 -0400 Lines: 49 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 24.181.226.14 Message-ID: <3b449884$1_2@dnews> X-Trace: dnews 994351236 24.181.226.14 (5 Jul 2001 09:40:36 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!howland.erols.net!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews