remove spaces from string

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
regex1
var text = '123 456 789'
var result = text.replace(/\s+/g, '')
ready
regex2
var text = '123 456 789'
var result = text.replace(/ /g, '')
ready
split-join
var text = '123 456 789'
var result = text.split(' ').join('')
ready

Revisions

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