I need to capitalize the first letter in a string, for example,
sumo => Sumo
and also need to capitalize the string with the following format,
Dr.ravi kumar => Dr.Ravi kumar
I am using a angular filter, which works well for the first condition but it doesn't work for the second one, this is the filter i am using,
angular
.module('app')
.filter('capitalize', function () {
return function (input, scope) {
if (input != null) {
input = input.toLowerCase();
return input.substring(0, 1).toUpperCase() + input.substring(1);
}
}
});