Sha256: 34279ed6facab3fa0250eaac83bae8fff196ef6c443a54beedfd0fb76c8b0998

Contents?: true

Size: 440 Bytes

Versions: 7

Compression:

Stored size: 440 Bytes

Contents

Object.extend(String.prototype, {

  upcase: function() {
    return this.toUpperCase();
  },

  downcase: function() {
    return this.toLowerCase();
  },
  
  strip: function() {
    return this.replace(/^\s+/, '').replace(/\s+$/, '');
  },
  
  toInteger: function() {
    return parseInt(this);
  },
  
  toSlug: function() {
    return this.strip().downcase().replace(/[^-a-z0-9~\s\.:;+=_]/g, '').replace(/[\s\.:;=+]+/g, '-');
  }

});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
radiant-0.5.0 public/javascripts/string.js
radiant-0.5.1 public/javascripts/string.js
radiant-0.5.2 public/javascripts/string.js
radiant-0.6.0 public/javascripts/string.js
radiant-0.6.1 public/javascripts/string.js
radiant-0.6.3 public/javascripts/string.js
radiant-0.6.2 public/javascripts/string.js