I have a DataTable
which is doing a GET
and populates, The data returned only has one option returned called which is a tel number but the tel num returned has 'test-' in front of it (e.g. test-010101010101).
What i want is to remove the 'test-' and then add spaces after every 4 digits (e.g. 0101 0101 0101.
I have tried the below but cant get it working
"createdRow": function (row, data, dataIndex) {
$('#dialPlanListDataTable').DataTable().rows().eq(0).each(function (index) {
var row = $('#dialPlanListDataTable').DataTable().row(index);
var data = row.data();
console.log(data)
var sd = data.text();
sd = parseInt(sd);
console.log(sd)
});
},
This results in