From 9903ddf76ba220de6db786c1291fcaf268de54b5 Mon Sep 17 00:00:00 2001 From: ruby0x1 Date: Sun, 16 May 2021 12:17:31 -0700 Subject: [PATCH] docs; string; clarify indexOf(_,_) to be clearer --- doc/site/modules/core/string.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/site/modules/core/string.markdown b/doc/site/modules/core/string.markdown index 4f91e7cf..e1a58515 100644 --- a/doc/site/modules/core/string.markdown +++ b/doc/site/modules/core/string.markdown @@ -148,8 +148,9 @@ It is a runtime error if `search` is not a string. ### **indexOf**(search, start) Returns the index of the first byte matching `search` in the string or `-1` if -`search` was not found, starting a byte offset `start`. The start can be -negative to count backwards from the end of the string. +`search` was not found, starting at byte offset `start`. The `start` offset can +also be negative, which will be offset relative to end of the string instead. +Searches forward, from the offset to the end of the string. It is a runtime error if `search` is not a string or `start` is not an integer index within the string's byte length.