зеркало из https://github.com/github/ruby.git
12 строки
263 B
YAML
12 строки
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")
|