Is there something like this? Like
string str=string.Format("I am {0}","nebulom"); in C# where "nebulom" is the first argument and placed in the place holder marked {0}. Or....
printf("%s","Hello"); in C... I need help. Thanks.
Printable View
Is there something like this? Like
string str=string.Format("I am {0}","nebulom"); in C# where "nebulom" is the first argument and placed in the place holder marked {0}. Or....
printf("%s","Hello"); in C... I need help. Thanks.
Oh, my bad. Sorry for posting. Never thought it looks like C.
String s=String.format("I am %s","nebulom");
Anyway, just don't wanna delete this as someone might find it useful.
String.format is one option, and a rather new one (Java 5). Before that, there was java.text.MessageFormat.