Skip to content
Advertisement

Prepend text to beginning of string

What is the fastest method, to add a new value at the beginning of a string?

Advertisement

Answer

var mystr = "Doe";
mystr = "John " + mystr;

Wouldn’t this work for you?

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement