I want to convert this key some_name and change it to Some Name.
How can i replace the dash and change the first letter of the words to caps for the key only
var data = $(this).serializeObject();
$.each(data, function(key, val) {
var tablefeed = $('<tr><td>'+key+'</td><td id="'+key+'">'+val+'</td><tr>').appendTo('#display');
});
$(".modal-body").html(tablefeed);
current output
key | val
some_name_11_ar_22 | joe
Expected output
Some Name 11 ar 22 | joe