Article View: borland.public.jbuilder.java.language
Article #7833Re: Format a String
From: Robert A. Vasseur
Date: Thu, 17 May 2001 19:31
Date: Thu, 17 May 2001 19:31
14 lines
1460 bytes
1460 bytes
Use something like format from corejava, i.e. String str = new format("Your
balance is %10.4f\n").format.(mynumber). Problem is, you can use only one
format at a time in a statement, so you may have to use several sequential
format statements to get what you want.
Adrian <nospam@anytime.com> wrote in message
news:3b020032.21421141@forums.borland.com...
> 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:
<3b042714_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!fr.usenet-edu.net!usenet-edu.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b020032.21421141@forums.borland.com>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-17 12:45:14 PST From: "Robert A. Vasseur" <vasseura@mscomm.com> Newsgroups: borland.public.jbuilder.java.language References: <3b020032.21421141@forums.borland.com> Subject: Re: Format a String Date: Thu, 17 May 2001 12:31:47 -0700 Lines: 16 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 NNTP-Posting-Host: 131.161.91.102 Message-ID: <3b042714_1@dnews> X-Trace: dnews 990127892 131.161.91.102 (17 May 2001 12:31:32 -0700) Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!fr.usenet-edu.net!usenet-edu.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews