Trimming leading slash (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script type="text/javascript">
var string = '/download/';
</script>

Setup

var regexp = /^\//;

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
string = string.replace(regexp,'')
ready
String functions
if(string.charAt(0)=='/') string = string.substring(1)
ready

Revisions

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