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

fix #3217 (string.replace)

This commit is contained in:
BigBlack
2019-12-27 12:20:06 +08:00
committed by Alexander Medvednikov
parent e20ca28d5c
commit 98b81252b7
2 changed files with 4 additions and 1 deletions

View File

@ -152,7 +152,7 @@ pub fn (s string) replace(rep, with string) string {
break
}
idxs << idx
idx++
idx += rep.len
}
// Dont change the string if there's nothing to replace
if idxs.len == 0 {