ba5eb47d143f77b6b423bdcf36015a70505d142d kent Thu Dec 9 12:52:27 2021 -0800 Documenting comparison operators in strex. diff --git src/lib/strex.doc src/lib/strex.doc index 083202f..cde94b0 100644 --- src/lib/strex.doc +++ src/lib/strex.doc @@ -1,20 +1,27 @@ The strex language is a small string expression evaluation language. This document describes its built in functions and operators: -+ - returns the concatenation of the surrounding strings or the addition of surrounding ++ returns the concatenation of the surrounding strings or the addition of surrounding numbers. Will convert a number to a string in mixed expressions += returns true if two items are the same. For strings ignores case +!= returns true if two items are not the same. For strings ignores case +> Greater than. Converts mixed expressions to strings. Ignores case in strings +>= Greater or equal. Converts mixed expressions to strings. Ignores case in strings +> Less than. Converts mixed expressions to strings. Ignores case in strings +>= Less or equal. Converts mixed expressions to strings. Ignores case in strings + [index] - selects a character from string given an integer zero based index. As in Python if index is negative it selects characters from the end of the string. -1 corresponds to the last character of string, as 0 corresponds to first. Returns empty string if index out of range. between(prefix, string, suffix) - returns the part of string found between prefix and suffix example: between("abc", "01234abcHelloxyz56789", "xyz") fetches just "Hello" If there are multiple places the prefix occurs, it will choose the first one, and the then the first place the suffix matches after that. The biologist might think of it as a text oriented PCR, though the primer prefix and suffixes are not included in the output. The prefix "" corresponds to beginning of string and the suffix "" corresponds to end. Returns empty string if nothing found. word(string, index) - white space separated word from string of given 0 based index.