Javascript Remove Newline From End Of String