From abcbba1e81ac25c3a66fb45bde180b1d2dee78f9 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Sun, 21 May 2023 08:46:11 +0900 Subject: [PATCH] builtin: fix typo in string.js.v (#18213) --- vlib/builtin/js/string.js.v | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vlib/builtin/js/string.js.v b/vlib/builtin/js/string.js.v index 518779d21c..dd1fff1424 100644 --- a/vlib/builtin/js/string.js.v +++ b/vlib/builtin/js/string.js.v @@ -595,7 +595,7 @@ pub fn (s string) split_nth(delim string, nth int) []string { } else { mut start := 0 - // Take the left part for each delimiter occurence + // Take the left part for each delimiter occurrence for i <= s.len { is_delim := i + delim.len <= s.len && s[i..i + delim.len] == delim if is_delim { @@ -625,7 +625,7 @@ struct RepIndex { val_idx int } -// replace_each replaces all occurences of the string pairs given in `vals`. +// replace_each replaces all occurrences of the string pairs given in `vals`. // Example: assert 'ABCD'.replace_each(['B','C/','C','D','D','C']) == 'AC/DC' [direct_array_access] pub fn (s string) replace_each(vals []string) string { @@ -722,7 +722,7 @@ pub fn (s string) replace_each(vals []string) string { return b } -// last_index returns the position of the last occurence of the input string. +// last_index returns the position of the last occurrence of the input string. fn (s string) last_index_(p string) int { if p.len > s.len || p.len == 0 { return -1 @@ -741,7 +741,7 @@ fn (s string) last_index_(p string) int { return -1 } -// last_index returns the position of the last occurence of the input string. +// last_index returns the position of the last occurrence of the input string. pub fn (s string) last_index(p string) ?int { idx := s.last_index_(p) if idx == -1 { @@ -800,7 +800,7 @@ pub fn (s string) split_into_lines() []string { return res } -// replace_once replaces the first occurence of `rep` with the string passed in `with`. +// replace_once replaces the first occurrence of `rep` with the string passed in `with`. pub fn (s string) replace_once(rep string, with_ string) string { s2 := '' #s2.val = s.str.replace(rep.str,with_.str)