From f3a6c570e2325116a89f1a00e11040fa205f8ecb Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 5 Feb 2023 23:24:36 +1100 Subject: [PATCH] Added the compound library page --- README.md | 1 + compound-library.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 compound-library.md diff --git a/README.md b/README.md index a421396..4eacd33 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ print tally(); //3 * [Quick Start Guide](quick-start-guide) * [Types](types) * [Standard Library](standard-library) +* [Compound Library](compound-library) (under development) * [Timer Library](timer-library) * [Runner Library](runner-library) * [Game Engine](game-engine) diff --git a/compound-library.md b/compound-library.md new file mode 100644 index 0000000..e23e0e7 --- /dev/null +++ b/compound-library.md @@ -0,0 +1,31 @@ +# Compound Library + +The compound library contains a number of common utility functions for use with compound values, such as arrays, dictionaries and strings. These functions will allow you to manipulate these values in ways that would otherwise be quite difficult and inefficient using just Toy. + +The compound library is currently under development. + +The compound library can usually be accessed with the `import` keyword: + +``` +import compound; +``` + +## _toLower(self: string) + +This function returns a new string which is identical to the string `self`, except any uppercase letters are replaced with the corresponding lowercase letters. + +## _toUpper(self: string) + +This function returns a new string which is identical to the string `self`, except any lowercase letters are replaced with the corresponding uppercase letters. + +## _trim(self: string, trimChars: string = " \t\n\r") + +This function returns a new string which is identical to the string `self`, except any characters at the beginning or end of `self` which are present in the argument `trimChars` are removed. The argument `trimChars` is optional, and has the following characters as the default value: + +* The space character +* The horizontal tab character +* The newline character +* The carriage return character + +These characters used because they are the only control characters currently supported by Toy. +