i am tired of writing this:
string_needed=”prefix…..” + topic + “suffix….” + name + “testing”;
i would think someone might have done something about this by now 😉
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ES6 Update:
ES6 added template strings, which use backticks (`) instead of single or double quotes. In a template string, you can use the
${}syntax to add expressions. Using your example, it would be:Original answer:
Sorry 🙁
I like to take advantage of Array.join:
or use
String.concator you could write your own concatenate function:
or use a 3rd-party
sprintffunction, such as http://www.diveintojavascript.com/projects/javascript-sprintf