I have used following method to do the changes, but I'm getting additional spaces after adding the new line. I used trim(), but it makes the value meaningless.
function addSpace() {
var columnValue = "ER Throttle Position ER Throttle Position ER Throt";
var result = "";
while (columnValue.length > 0) {
result += columnValue.substring(0, 15) + "\n";
columnValue = columnValue.substring(15);
}
columnValue = result;
return columnValue;
}
console.log(addSpace());