jQuery in Action, 2nd edition*
The moose likes Java in General and the fly likes can we have parametrized String in java ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "can we have parametrized String in java ?" Watch "can we have parametrized String in java ?" New topic

can we have parametrized String in java ?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
thank you for reading my post
i want to know can we have parametrize String in java ?
for example i need a template string like :

"you have contact us from email address [param] and here is your detialed answer"+
"your transfered amount is "+ [param]
"your purchased service is "+[param]
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Yes. Have a look at the MessageFormat class.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074

Or, if you are using Java 5 or newer, the method String.format().

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
I agree. Here's the link: http://aspose.com/file-tools
subject: can we have parametrized String in java ?
Similar Threads
session cookie problem when UAT and production runs at same time by a user.
Context param values from web.xml
Managed beans aren't constructed running on JBoss 5.1.0 (works fine with Tomcat 6)
Converting String to an array.
Application Resources.properties