return format.replace(/\{(\d+)\}/g, function(m, i){
return Roo.util.Format.htmlEncode(args[i]);
});
- }.
+ }
});
*
* @return {String} The clean string
*/
-String.prototype.unicodeClean: function () {
- return this.replace(/[\s\S]/g,
- function(character) {
- if (character.charCodeAt()< 256) {
- return character;
- }
- try {
- encodeURIComponent(character);
- } catch(e) {
- return '';
- }
- return character;
- }
- );
- }
+String.prototype.unicodeClean = function () {
+ return this.replace(/[\s\S]/g,
+ function(character) {
+ if (character.charCodeAt()< 256) {
+ return character;
+ }
+ try {
+ encodeURIComponent(character);
+ } catch(e) {
+ return '';
+ }
+ return character;
+ }
+ );
+};
+
+
+/**
+ * Make the first letter of a string uppercase
+ *
+ * @return {String} The new string.
+ */
+String.prototype.toUpperCaseFirst = function () {
+ return this.charAt(0).toUpperCase() + this.slice(1);
+};