JSFiddle - React, Tailwind, and code Playground
JavaScript
var string = 'acbACB',
arr = string.split('');
arr.sort(function(x,y) {
if(x.toLowerCase() !== y.toLowerCase()) {
x = x.toLowerCase();
y = y.toLowerCase();
}
return x > y ? 1 : (x < y ? -1 : 0);
});
alert(arr.join(''));