This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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 Head First Android this week in the Android 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: 14916

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

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: can we have parametrized String in java ?
It's not a secret anymore!