Action Directory / Title Case(单词首字母全部大写)

Install

Capitalizes the first letter of each highlighted word.

Shared by

Script

var SelectedText = editor.getSelectedText();

String.prototype.toProperCase = function () {
    return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
};

SelectedText = SelectedText.toProperCase()

editor.replaceSelection(SelectedText);