Article View: borland.public.jbuilder.java.language
Article #7817Re: Format a String
From: Fredrik Skanberg
Date: Wed, 16 May 2001 06:38
Date: Wed, 16 May 2001 06:38
22 lines
1654 bytes
1654 bytes
A correction: there is a class in the Java API that can do this. It's called MessageFormat and could be found in the java.text package. But the library at http://www.braju.com/ probably uses the same format you asked about. /Fredrik Fredrik Skanberg wrote: > > There is no such class in the Java API. But you can download a sprintf() > function here: http://www.braju.com/ > > /Fredrik > > Adrian wrote: > > > > Is there a specific Class that can be used to place values into a > > String. > > > > ie > > String s = "Hello %s how are you ?"; > > String ns = FormatString (s, "Adrian"); // substitute %s for Adrian
Technical Details
Message-ID:
<3B022069.3BD3864C@liber.se>Path:
arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!128.230.129.106!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b020032.21421141@forums.borland.com> <3B021B23.6C2E5F4F@liber.se>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,5539798795b74f52 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-05-16 00:12:05 PST Message-ID: <3B022069.3BD3864C@liber.se> Date: Wed, 16 May 2001 08:38:33 +0200 From: Fredrik Skanberg <fredrik.skanberg@liber.se> X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: Re: Format a String References: <3b020032.21421141@forums.borland.com> <3B021B23.6C2E5F4F@liber.se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 193.14.71.253 X-Trace: dnews 989995118 193.14.71.253 (15 May 2001 23:38:38 -0700) Lines: 22 Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!128.230.129.106!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews