I am using Select2 Version 4.0.1, while searching any name, I would like to show only those records which is matched by first character. eg: I start from "c" then show only those names which start from "c". See attachment.
I tried different methods was available on stackoverflow, but no luck. eg: tried this one also, but got this error "select2 text.toUpperCase is not a function"
$("select").select2({
matcher: function(term, text) {
return text.toUpperCase().indexOf(term.toUpperCase())==0;
}
});