Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I need to know do we have string.format option in javascript very similar to C#.
C#
//Sample Snippet in C#
String strFormat = "Name:{0}, Dept:{1}",
String myContent = String.Format(strFormat, "Jaiki", "Admin");


Thanks in Advance.
Regards,Mahe
Posted

There is readely available function. Check the link where you can implement your own custom code.

http://stackoverflow.com/questions/1038746/equivalent-of-string-format-in-jquery[^]
 
Share this answer
 
See this: String.Format in JavaScript[^]

Regards..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900