Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by LaserBeam

Hi,

I would like to use this apostrophe ' in my String variable's text; but as this apostrophe is used to define the beginning and end of the text it does not work. Does anyone know a workaround?

1 decade ago by Ruairi

Use double quotes

var hello = "he'llo";

You can specify the contents of a string in JavaScript with either 'string' or "string".

1 decade ago by Arantor

Or you can use \ to escape it, e.g. var str = 'Arantor\'s string';

1 decade ago by LaserBeam

Both works great! Thanks guys!
Page 1 of 1
« first « previous next › last »