From 9bb886db8a8755cdd6a55e11bbf1951cdf469269 Mon Sep 17 00:00:00 2001 From: DiamondNether90 Date: Thu, 11 Sep 2025 10:58:19 +1000 Subject: [PATCH] Add packages/strings/strings.md --- packages/strings/strings.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/strings/strings.md diff --git a/packages/strings/strings.md b/packages/strings/strings.md new file mode 100644 index 0000000..b5e207e --- /dev/null +++ b/packages/strings/strings.md @@ -0,0 +1,27 @@ +# Strings library + +This library adds extra string manipulation functions to ground. It is entirely coded in ground. + +Please note that you cannot copy a single function from the package, as some functions rely on other functions in the library. + +## Functions + +### fun -char !findChar -string &str -char &char + +Finds the index of $char in $string + +### fun -char !findCharInstance -string &str -char &char -int &instance + +Finds the index of the `$instance`th instance of $char in $str + +### fun -string !mid -string &str -int &idx -int &len + +Finds $len characters of $str, starting at $idx. + +### fun -string !inBrackets -string &str -char &left -char &right -int &instance + +Finds the content of the `$instance`th instance of brackets, with the left bracket being the $left char and the right bracket of $right char. + +### fun -string !matchStart -string &str -string &instr + +Checks if the start of $str matches $instr. \ No newline at end of file