|
Awkl
|
Functions | |
| auto | idx (string s, number i) -> string|number |
| Index a string as if first character has index 1. | |
| auto | idx0 (string s, number i) -> string|number |
| Index a string as if first character has index 0, with negative indexing. | |
| string | slice (string s, number a, number b) |
| Slice a string as if first character has index 1. | |
| string | slice0 (string s, number a, number b) |
| Slice a string as if first character has index 0. | |
| auto | find (string s1, string s2, number a, number b) -> string|number |
| Lowest index starting from 1 where a substring is found in a string or its slice starting from 1. | |
| auto | find0 (string s1, string s2, number a, number b) -> string|number |
| Lowest index starting from 0 where a substring is found in a string or its slice starting from 0. | |
| auto | indices (array R, string s1, string s2) |
| Get indices, starting from 1, where a substring is found in a string, non-overlapping. | |
| auto | rfind (string s1, string s2, number a, number b) -> string|number |
| Highest index starting from 1 where a substring is found in a string or its slice starting from 1. | |
| auto | rfind0 (string s1, string s2, number a, number b) -> string|number |
| Highest index starting from 0 where a substring is found in a string or its slice starting from 0. | |
| unassigned | partition (array A, string s, string sep) |
| Split the string at the first occurrence of a separator. | |
| unassigned | rpartition (array A, string s, string sep) |
| Split the string at the last occurrence of a separator. | |
| number | splitLines (string s, array A) |
| Split lines in a string at line boundaries. | |
| string | join (array A, string s=" ") |
| Join array elements with separator. | |
| number | startsWith (string s1, string s2) |
| Check if string starts with specific prefix. | |
| number | endsWith (string s1, string s2) |
| Check if string ends with specific suffix. | |
| string | rep (string s, number n) |
| Repeat string n number of times. | |
| string | escapeRe (string s) |
| Escape regex special characters. | |
| string | replaceIdx (string s, string rep, number idx) |
| Replace a character in a specific index with a string. | |
| string | replaceRange (string s, string rep, number i, number n) |
Replace a string in a specific index range with a string. Similar to substr() | |
| string | rmPrefix (string s, string pre) |
| Remove matching prefix. | |
| string | rmSuffix (string s, string suf) |
| Remove matching suffix. | |
| string | lstrip (string s, string chars) |
| Remove leading characters. | |
| string | rstrip (string s, string chars) |
| Remove trailing characters. | |
| string | strip (string s, string chars) |
| Remove leading and trailing characters. | |
| unassigned | chars (array A, string s, number i0=1) |
| Fill indexed array with characters in a string. | |
| unassigned | fields (array A) |
| Fill indexed array with awk fields. | |
| string | lc (string s) |
| Lower case. | |
| string | uc (string s) |
| Upper case. | |
| auto | ucfirst (s) |
| Upper case first character. | |
| auto | lcfirst (s) |
| Lower case first character. | |
| string | tc (string s) |
| Title case a string. | |
| string | tclc (string s) |
| Title case a string and rest lower case. | |
| string | ltrim (string s) |
| Remove leading blanks. | |
| string | rtrim (string s) |
| Remove trailing blanks. | |
| string | trim (string s) |
| Remove leading and trailing blanks. | |
| string | chop (string s, number n=1) |
| Remove last characters. | |
| string | chomp (string s) |
Remove last character if it is linebreak \n | |
| string | rev (string s) |
| Revert string. | |
| string | chr (number n) |
| Chr function. | |
| auto | _ord_init (number l=0, number h=1114111) |
| Fill the ord table. | |
| number | ord (string s) |
| Ord function. | |
| string | indent (string s, string|number i) |
| Indent. | |
| string | ljust (string s, number w, string c=" ", number l) |
| Left justify. | |
| string | rjust (string s, number w, string c=" ", number l) |
| Right justify. | |
| auto | serialize (x) |
| Serialized representation of a string. | |
| string | repr (any x) |
| String representation of a variable. | |
| string | csvQuote (string s) |
| CSV-quote a string. | |
| auto | comb () |
Variables | |
| string | lower = "abcdefghijklmnopqrstuvwxyz" |
Lower-case letters in ASCII. Like POSIX [:lower:] | |
| string | upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
Upper-case letters in ASCII. Like POSIX [:upper:] | |
| string | digit = "0123456789" |
Digits in ASCII. Like POSIX [:digit:] | |
| string | alpha = lower upper |
Alphabetic characters in ASCII. Like POSIX [:alpha:] | |
| string | alnum = alpha digit |
Alphanumeric characters in ASCII. Like POSIX [:alnum:] | |
| string | word = alnum "_" |
Alphanumeric characters and _ | |
| string | xdigit = "abcdefABCDEF" digit |
Hexadecimal digits in ASCII. Like POSIX [:xdigit:] | |
| string | blank = " \t" |
Blank characters in ASCII: space and tab. Like POSIX [:blank:] | |
| string | space = " \t\r\n\v\f" |
Space characters in ASCII: space, tab, carriage return, linebreak, vertical tab and form feed. Like POSIX [:space:] | |
| string | ascii |
| ASCII characters. | |
| string | cntrl |
Control characters in ASCII. Unicode C0 control code. Like POSIX [:cntrl:] | |
| string | graph |
Graphical characters: Alphanumeric characters and punctuations. Like POSIX [:graph:] | |
| string | print_ = " " graph |
Printable characters: Space and graphical characters. Like POSIX [:print:] | |
| string | punct = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" |
Punctuation characters in ASCII. Like POSIX [:punct:] | |
| string | ascii_letters = alpha |
| string | ascii_lowercase = lower |
| string | ascii_uppercase = upper |
| string | digits = digit |
| string | hexdigits = xdigit |
| string | octdigits = "01234567" |
| Octal digits in ASCII. | |
| string | punctuation = punct |
| string | whitespace = space |
| string | printable = digit alpha punct space |
| string | linebounds = "\n\r\v\f\034\035\205\342\200\250\342\200\251" |
| Single character line boundaries. | |
| number | _ordtab_init = 0 |
| array | ORDTAB [1] |
| auto str::_ord_init | ( | number | l = 0, |
| number | h = 1114111 ) |
Fill the ord table.
| l | Lower bound |
| h | Upper bound |
| unassigned str::chars | ( | array | A, |
| string | s, | ||
| number | i0 = 1 ) |
Fill indexed array with characters in a string.
| [out] | A | Indexed array to fill with characters |
| s | String from which to extract characters | |
| i0 | Starting index of the indexed array |
| string str::chomp | ( | string | s | ) |
Remove last character if it is linebreak \n
| s | Original string |
\n | string str::chop | ( | string | s, |
| number | n = 1 ) |
Remove last characters.
| s | Original string |
| n | Number of characters to remove. Optional |
n last characters removed | string str::chr | ( | number | n | ) |
Chr function.
| n | Decimal integer representation of a character in the system's character set |
| auto str::comb | ( | ) |
| string str::csvQuote | ( | string | s | ) |
CSV-quote a string.
| s | Original string |
| number str::endsWith | ( | string | s1, |
| string | s2 ) |
Check if string ends with specific suffix.
| s1 | String to match for suffix |
| s2 | Suffix to match |
| string str::escapeRe | ( | string | s | ) |
Escape regex special characters.
| s | String to escape |
\+*?[^]$(){}=!<>|:- escaped | unassigned str::fields | ( | array | A | ) |
Fill indexed array with awk fields.
| [out] | A | Indexed array to fill with current awk fields ($1, $2, etc.) |
| auto str::find | ( | string | s1, |
| string | s2, | ||
| number | a, | ||
| number | b ) -> string | number |
Lowest index starting from 1 where a substring is found in a string or its slice starting from 1.
| s1 | Containing string |
| s2 | Substring to find in containing string |
| a | Start slice index of containing string starting from 1. Optional |
| b | End slice index inclusive of containing string starting from 1. Optional |
| auto str::find0 | ( | string | s1, |
| string | s2, | ||
| number | a, | ||
| number | b ) -> string | number |
Lowest index starting from 0 where a substring is found in a string or its slice starting from 0.
| s1 | Containing string |
| s2 | Substring to find in containing string |
| a | Start slice index of containing string starting from 0. Optional |
| b | End slice index exclusive of containing string starting from 0. Optional |
| auto str::idx | ( | string | s, |
| number | i ) -> string | number |
Index a string as if first character has index 1.
| s | String to be indexed |
| i | Index integer. From 1 to the length of the string |
| auto str::idx0 | ( | string | s, |
| number | i ) -> string | number |
Index a string as if first character has index 0, with negative indexing.
| s | String to be indexed |
| i | Index integer. From minus the length of the string to the length of the string minus 1 |
| string str::indent | ( | string | s, |
| string|number | i ) |
Indent.
| s | Original string |
| i | Indentation string or number of spaces to indent |
| auto str::indices | ( | array | R, |
| string | s1, | ||
| string | s2 ) |
Get indices, starting from 1, where a substring is found in a string, non-overlapping.
| R | Array to be filled with indices starting from 1. If not found, the array is just deleted |
| s1 | Containing string |
| s2 | Substring to find in containing string |
| string str::join | ( | array | A, |
| string | s = " " ) |
Join array elements with separator.
| A | Array to get elements from |
| s | Separator |
| string str::lc | ( | string | s | ) |
Lower case.
| s | Original string |
| auto str::lcfirst | ( | s | ) |
Lower case first character.
| string str::ljust | ( | string | s, |
| number | w, | ||
| string | c = " ", | ||
| number | l ) |
Left justify.
| s | Original string |
| w | Width |
| c | Character to pad with |
| l | Alternative string length. Default: length of s |
w width filled with c characters to its right | string str::lstrip | ( | string | s, |
| string | chars ) |
Remove leading characters.
| s | Original string |
| chars | Characters to remove |
| string str::ltrim | ( | string | s | ) |
Remove leading blanks.
| s | Original string |
| number str::ord | ( | string | s | ) |
Ord function.
| s | Character. If a string is passed, it only uses its first character |
| unassigned str::partition | ( | array | A, |
| string | s, | ||
| string | sep ) |
Split the string at the first occurrence of a separator.
| [out] | A | Array to be filled with 3 string elements:
If the separator is not found, the 1° element is the whole string, and the rest are empty strings |
| s | String | |
| sep | Separator |
| string str::rep | ( | string | s, |
| number | n ) |
Repeat string n number of times.
| s | String to repeat |
| n | Number of times to repeat |
| string str::replaceIdx | ( | string | s, |
| string | rep, | ||
| number | idx ) |
Replace a character in a specific index with a string.
| s | Original string |
| rep | Replacement string |
| idx | Index in which to insert the replacement |
| string str::replaceRange | ( | string | s, |
| string | rep, | ||
| number | i, | ||
| number | n ) |
Replace a string in a specific index range with a string. Similar to substr()
| s | Original string |
| rep | Replacement string |
| i | Start index of substring to replace |
| n | Number of characters to replace |
| string str::repr | ( | any | x | ) |
String representation of a variable.
| x | Variable |
| string str::rev | ( | string | s | ) |
Revert string.
| s | Original string |
| auto str::rfind | ( | string | s1, |
| string | s2, | ||
| number | a, | ||
| number | b ) -> string | number |
Highest index starting from 1 where a substring is found in a string or its slice starting from 1.
| s1 | Containing string |
| s2 | Substring to find in containing string |
| a | Start slice index of containing string starting from 0. Optional |
| b | End slice index inclusive of containing string starting from 0. Optional |
| auto str::rfind0 | ( | string | s1, |
| string | s2, | ||
| number | a, | ||
| number | b ) -> string | number |
Highest index starting from 0 where a substring is found in a string or its slice starting from 0.
| s1 | Containing string |
| s2 | Substring to find in containing string |
| a | Start slice index of containing string starting from 0. Optional |
| b | End slice index exclusive of containing string starting from 0. Optional |
| string str::rjust | ( | string | s, |
| number | w, | ||
| string | c = " ", | ||
| number | l ) |
Right justify.
| s | Original string |
| w | Width |
| c | Character to pad with |
| l | Alternative string length. Default: length of s |
w width filled with c characters to its left | string str::rmPrefix | ( | string | s, |
| string | pre ) |
Remove matching prefix.
| s | String from which to remove a prefix |
| pre | Prefix to remove |
| string str::rmSuffix | ( | string | s, |
| string | suf ) |
Remove matching suffix.
| s | String from which to remove a suffix |
| suf | Suffix to remove |
| unassigned str::rpartition | ( | array | A, |
| string | s, | ||
| string | sep ) |
Split the string at the last occurrence of a separator.
| [out] | A | Array to be filled with 3 string elements
If the separator is not found, the 1° element is the whole string, and the rest are empty strings |
| s | String | |
| sep | Separator |
| string str::rstrip | ( | string | s, |
| string | chars ) |
Remove trailing characters.
| s | Original string |
| chars | Characters to remove |
| string str::rtrim | ( | string | s | ) |
Remove trailing blanks.
| s | Original string |
| auto str::serialize | ( | x | ) |
Serialized representation of a string.
| string str::slice | ( | string | s, |
| number | a, | ||
| number | b ) |
Slice a string as if first character has index 1.
| s | String to be sliced |
| a | Start index starting from 1 |
| b | End index inclusive starting from 1. Optional |
| string str::slice0 | ( | string | s, |
| number | a, | ||
| number | b ) |
Slice a string as if first character has index 0.
| s | String to be sliced |
| a | Start index starting from 0 |
| b | End index exclusive starting from 0. Optional |
| number str::splitLines | ( | string | s, |
| array | A ) |
Split lines in a string at line boundaries.
| s | Original string |
| A | Array to be filled with line contents |
| number str::startsWith | ( | string | s1, |
| string | s2 ) |
Check if string starts with specific prefix.
| s1 | String to match for prefix |
| s2 | Prefix to match |
| string str::strip | ( | string | s, |
| string | chars ) |
Remove leading and trailing characters.
| s | Original string |
| chars | Characters to remove |
| string str::tc | ( | string | s | ) |
Title case a string.
| s | Original string |
| string str::tclc | ( | string | s | ) |
Title case a string and rest lower case.
| s | Original string |
| string str::trim | ( | string | s | ) |
Remove leading and trailing blanks.
| s | Original string |
| string str::uc | ( | string | s | ) |
Upper case.
| s | Original string |
| auto str::ucfirst | ( | s | ) |
Upper case first character.
| number str::_ordtab_init = 0 |
| string str::ascii |
ASCII characters.
| string str::ascii_letters = alpha |
| string str::ascii_lowercase = lower |
| string str::ascii_uppercase = upper |
| string str::blank = " \t" |
Blank characters in ASCII: space and tab. Like POSIX [:blank:]
| string str::cntrl |
Control characters in ASCII. Unicode C0 control code. Like POSIX [:cntrl:]
| string str::digit = "0123456789" |
Digits in ASCII. Like POSIX [:digit:]
| string str::digits = digit |
| string str::graph |
Graphical characters: Alphanumeric characters and punctuations. Like POSIX [:graph:]
| string str::hexdigits = xdigit |
| string str::linebounds = "\n\r\v\f\034\035\205\342\200\250\342\200\251" |
Single character line boundaries.
| string str::lower = "abcdefghijklmnopqrstuvwxyz" |
Lower-case letters in ASCII. Like POSIX [:lower:]
| string str::octdigits = "01234567" |
Octal digits in ASCII.
| array str::ORDTAB[1] |
| string str::print_ = " " graph |
Printable characters: Space and graphical characters. Like POSIX [:print:]
| string str::punct = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" |
Punctuation characters in ASCII. Like POSIX [:punct:]
| string str::punctuation = punct |
| string str::space = " \t\r\n\v\f" |
Space characters in ASCII: space, tab, carriage return, linebreak, vertical tab and form feed. Like POSIX [:space:]
| string str::upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
Upper-case letters in ASCII. Like POSIX [:upper:]
| string str::whitespace = space |
| string str::word = alnum "_" |
Alphanumeric characters and _
| string str::xdigit = "abcdefABCDEF" digit |
Hexadecimal digits in ASCII. Like POSIX [:xdigit:]