aspose file tools*
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
Author

can we have parametrized String in java ?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
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
Bartender

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: 14104
    
  16

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 ?