wood burning stoves 2.0*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
It is sorta covered in the JavaRanch Style Guide.
subject: can we have parametrized String in java ?
Similar Threads
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
session cookie problem when UAT and production runs at same time by a user.