Trimming leading slash (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
string = string.replace(/^\//,'')
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.