var a=1, b=-2, m=-3; alert( ("Уравнения прямой: " + a + "*x+" + b + "*y+" + m + "=0").replace( /\+-/g, '-' ) );