Hi,
I'm creating a business card template and I have a problem getting rid of of a separator at the end of a text line when there's a line break. The customer can select different brands in a html checkbox list and automatically the selected brands align with comma between them. I have managed to replace the comma with dash and no break space and allow only linebreak after the dash. But I also want to remove the dash at the end of the line in case there is a line break.
Image: http://s30.postimg.org/ajtqvu94h/procar.jpg
This is code I´m using so far:
var mystring = (Field("Extra line"))
function NoBreak(s)
{
return s.replace(/ /g, " ");
}
mystring2 = NoBreak(mystring);
var newchar = ' - '
mystring3 = mystring2.split(',').join(newchar);
return mystring3;
Any help would be appreciated.