return Roo.util.Format.htmlEncode(args[i]);
});
}
- function unicodeClean() {
- return this.replace(/[\s\S]/g, function(character) {
- if (character.charCodeAt()< 256) {
- return character;
- }
- try {
- encodeURIComponent(character);
- } catch(e) {
- return '';
- }
- return character;
- });
});
String.prototype.toggle = function(value, other){
return this == value ? other : value;
-};
\ No newline at end of file
+};
+
+
+/**
+ * Remove invalid unicode characters from a string
+ *
+ * @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;
+ }
+ );
+};
+
+
+/**
+ * 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);
+};
+