1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cache string.hash()

This commit is contained in:
Alexander Medvednikov
2019-07-10 09:48:10 +02:00
parent 2ab1ad8b30
commit 28843a12c7
7 changed files with 15 additions and 21 deletions

View File

@ -155,12 +155,12 @@ fn test_replace() {
assert b==('hello world')
b = b.replace('h', 'H')
assert b==('Hello world')
b = b.replace('kek', 'lul')
b = b.replace('foo', 'bar')
assert b==('Hello world')
s := 'hey man how are you'
assert s.replace('man ', '') == 'hey how are you'
lol := 'lol lol lol'
assert lol.replace('lol', 'kek') == 'kek kek kek'
assert lol.replace('lol', 'LOL') == 'LOL LOL LOL'
b = 'oneBtwoBBthree'
assert b.replace('B', '') == 'onetwothree'
b = '**char'