mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
12 lines
263 B
YAML
12 lines
263 B
YAML
|
prelude: |
|
||
|
long_string = "x"*1000+"-hår"
|
||
|
benchmark:
|
||
|
regexp-short: |
|
||
|
"x-hår".slice!(/-(.)(.)(.)/, 3)
|
||
|
regexp-long: |
|
||
|
long_string.dup.slice!(/-(.)(.)(.)/, 3)
|
||
|
string-short: |
|
||
|
"x-hår".slice!("r")
|
||
|
string-long: |
|
||
|
long_string.dup.slice!("r")
|