Modify string/find* docstrings (#1863)

Co-authored-by: sogaiu <983021772@users.noreply.github.com>
This commit is contained in:
sogaiu
2026-09-12 18:39:54 -05:00
committed by GitHub
co-authored by sogaiu
parent 2851d26802
commit 71f9535509
+10 -7
View File
@@ -308,10 +308,11 @@ static void findsetup(int32_t argc, Janet *argv, struct kmp_state *s, int32_t ex
}
JANET_CORE_FN(cfun_string_find,
"(string/find patt str &opt start-index)",
"(string/find patt str &opt start)",
"Searches for the first instance of pattern `patt` in string "
"`str`. Returns the index of the first character in `patt` if found, "
"otherwise returns nil.") {
"`str`. Returns the index of the first character in `patt` if "
"found, otherwise returns nil. Search begins from `start` if "
"provided.") {
int32_t result;
struct kmp_state state;
findsetup(argc, argv, &state, 0);
@@ -347,11 +348,13 @@ JANET_CORE_FN(cfun_string_hassuffix,
}
JANET_CORE_FN(cfun_string_findall,
"(string/find-all patt str &opt start-index)",
"(string/find-all patt str &opt start)",
"Searches for all instances of pattern `patt` in string "
"`str`. Returns an array of all indices of found patterns. Overlapping "
"instances of the pattern are counted individually, meaning a byte in `str` "
"may contribute to multiple found patterns.") {
"`str`. Returns an array of all indices of found patterns. "
"Overlapping instances of the pattern are counted "
"individually, meaning a byte in `str` may contribute to "
"multiple found patterns. Search begins from `start` if "
"provided.") {
int32_t result;
struct kmp_state state;
findsetup(argc, argv, &state, 0);