From 225b958351678c258cb0f22791c8a797c56e17ab Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Sun, 12 Jun 2022 02:52:14 +0200 Subject: [PATCH] Update README.md [skip ci] --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 9a18049..8ff7f9e 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,20 @@ A list of all the functions and methods that are added by this plugin. * `string::regex_replace(string, expr, with)`: Replaces the matching substring with another string. * `string::regex_match(string, expr)`: Determines if a regex matches the entire string and returns the matches as an array. * `string::regex_search(string, expr)`: Determines if a regex matches part of the string. + ```gsc + init() + { + assert(string::to_upper("hello") == "HELLO"); + assert(string::to_lower("HELLO") == "hello"); + assert(string::is_numeric("12345")); + assert(string::starts_with("hello world", "hello")); + assert(string::ends_with("hello world", "world")); + assert(string::replace("hello", "e", "o") == "hollo"); + assert(string::regex_replace("hello", "h|e|l|o", "a") == "aaaaa"); + assert(string::regex_match("hello", "^hello$").size == 1); + assert(string::regex_search("hello", "e|o")); + } + ``` ## Misc * `array(...)`: Creates an array from a list of arguments: