b115bef91d8de7132ccdbeca330a9941a5ffee65 kent Thu Sep 5 16:27:05 2019 -0700 Fixed a few typos in comments and docs. diff --git src/lib/strex.doc src/lib/strex.doc index c14f514..083202f 100644 --- src/lib/strex.doc +++ src/lib/strex.doc @@ -65,31 +65,31 @@ chop_range(string, splitter, start, end) - returns subset of a string delineated by splitter, which should just be a single character untsv(string, index) - separate by tab. Synonym for separate(string, '\t', index) uncsv(string, index) - do comma separated value extraction of string. Includes quote escaping. trim(string) - returns copy of string with leading and trailing spaces removed strip(string, toRemove) - remove all occurrences of any character in toRemove from string tidy(prefix, string, suffix) - helps trim unwanted ends off of a string. If prefix is present in the string, the prefix and everything before it will be cut off. Blank prefixes have no effect. Similarly if the suffix is present in what is left of the string after the prefix is trimmed, then the parts of the string from where the suffix - starts will be cut off. BLank suffixes have no effect. + starts will be cut off. Blank suffixes have no effect. example: tidy("", "myreads.fastq.gz", ".gz") returns "myreads.fastq" example: tidy("", "myreads.fastq", ".gz") returns "myreads.fastq" example: tidy("my/", "deep/path/to/my/reads.fastq.gz", ".gz") returns "reads.fastq" example: tidy("my/", "deep/path/to/my/reads.fastq.gz", ".fastq") returns "reads" example: tidy("my/", "deep/path/to/your/reads.fastq.gz", ".fastq") returns "deep/path/to/your/reads" upper(string) - returns all upper case version of string lower(string) - returns all lower case version of string @@ -143,31 +143,31 @@ or - logical or operation extended to strings and numbers. for logic - if any or-separated-values are true, return true, else false for numbers - if any or-separated non-zero numbers exist, return first one else 0 for strings - if any or-separated non-empty strings exists, return first one else "" In mixed operations result is converted to strings if strings are involved or the values "" and "true" if no strings are involved. For the pure string case this can be useful for setting defaults as well. For instance presuming you might or might not have filled in values for the city or country variables in the given expression that would return a location of some sort (city or country or "somewhere in the universe") Note the parenthesis around the ors is good to have because of the very low precedence of the logical operators. and - logical and operation extended to strings and numbers - for logic - if all and-separated-values are tru, return true, else false + for logic - if all and-separated-values are true, return true, else false for numbers - if all numbers are non-zero return true else false for strings - if all and-separated strings are nonempty, return true, else "" In mixed operations result is converted to strings if strings are involved or the values "" and "true" if no strings are involved. not - logical not. Converts false, zero, and the empty string to true, everything else to false now() - returns current time and date in ISO 1806 format using the variant that has the local time and timezone, for instance 2019-08-14T23:35:22-0700 for 11:35 pm in California during daylight savings time. import("file.strex") - act as if the contents of file.strex, which should be a valid strex expression but one that can span multiple lines, were here instead of this import expression. This is useful for debugging and reusing complex expressions. (You'll get line numbers from the file in the error message, which helps localize it.)