As an editing feature, it would be very helpful to have the possibility of converting a selected string to uppercase, lowercase, or title-case. I.e., LIKE THIS, like this, or Like This.
Thanks, Dominik
You can easily create user-defined macros for this (User -> Edit Macros):
%SCRIPT cursor.replaceSelectedText(cursor.selectedText().toUpperCase())
and similar ones. See the documentation for more on user macros.
Since this feature is not very widely used, I wouldn't make it a dedicated operation built into TXS.
Anonymous
You seem to have CSS turned off. Please don't fill out this field.
Thanks! The Upper case:
and Lower case:
%SCRIPT cursor.replaceSelectedText(cursor.selectedText().toLowerCase())
are easy. Can someone help with the title case?
For example
%SCRIPT function toTitleCase(str) { return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); } cursor.replaceSelectedText(toTitleCase(cursor.selectedText()))
You can easily create user-defined macros for this (User -> Edit Macros):
%SCRIPT
cursor.replaceSelectedText(cursor.selectedText().toUpperCase())
and similar ones. See the documentation for more on user macros.
Since this feature is not very widely used, I wouldn't make it a dedicated operation built into TXS.
Thanks! The Upper case:
%SCRIPT
cursor.replaceSelectedText(cursor.selectedText().toUpperCase())
and Lower case:
%SCRIPT
cursor.replaceSelectedText(cursor.selectedText().toLowerCase())
are easy. Can someone help with the title case?
For example