aboutsummaryrefslogtreecommitdiff
path: root/core/strings
diff options
context:
space:
mode:
authorAdam Rasburn <AdamRasburn@proton.me>2022-09-12 07:37:15 +1200
committerAdam Rasburn <AdamRasburn@proton.me>2022-09-12 07:37:15 +1200
commit0f036eebc0cf9c1b6bb03ea5561dc6e1d8e52e0c (patch)
tree8f09e36ed86969305d10fe2a313c502a72a5556c /core/strings
parente008eeac6ae553da96dba0c0cdae8def6a03b92b (diff)
doc fix for strings.last_index_any
Diffstat (limited to 'core/strings')
-rw-r--r--core/strings/strings.odin12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/strings/strings.odin b/core/strings/strings.odin
index fcfc133f3..a0f553a68 100644
--- a/core/strings/strings.odin
+++ b/core/strings/strings.odin
@@ -937,14 +937,14 @@ index_any :: proc(s, chars: string) -> int {
}
/*
- returns the index of any first char of `chars` found in `s`, -1 if not found
+ returns the last matching index in `s` of any char in `chars` found in `s`, -1 if not found
iterates the string in reverse
- strings.index_any("test", "s") -> 2
- strings.index_any("test", "se") -> 2
- strings.index_any("test", "et") -> 1
- strings.index_any("test", "set") -> 3
- strings.index_any("test", "x") -> -1
+ strings.last_index_any("test", "s") -> 2
+ strings.last_index_any("test", "se") -> 2
+ strings.last_index_any("test", "et") -> 3
+ strings.last_index_any("test", "set") -> 3
+ strings.last_index_any("test", "x") -> -1
*/
last_index_any :: proc(s, chars: string) -> int {
if chars == "" {