title case test

Benchmark created by George Alton on


Setup

var titleCaseNoSpace1 = function(s){
        return s.replace(/\B\w/g, function(m){return m.toLowerCase()}).replace(/ /g, '');
    };
    
    var titleCaseNoSpace2 = function(s){
        return s.replace(/\B\w*/g, function(m){return m.toLowerCase()}).replace(/ /g, '');
    };

Test runner

Ready to run.

Testing in
TestOps/sec
without star
titleCaseNoSpace1('SOME CAPITAL STRING')
ready
with star
titleCaseNoSpace2('SOME CAPITAL STRING')
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by George Alton on