[ Prev ] [ Index ] [ Next ]

String Functions

Created Saturday 15 August 2020

getline reads next line of input
gsub(r,s) substitutes s for r globally in current record, returns number of substitutions
gsub(r,s,t) substitutes s for r globally in string t, returns number of substitutions
index(s,t) returns position of string t in s, 0 if not present
length(s) returns length of s
match(s,r) returns the position in s where r occurs, 0 if not present. See built-in variables RSTART and RLENGTH
split(s,a) splits s into array a on FS, returns number of fields
split(s,a,r) splits s into array a on r, returns number of fields
sprintf(fmt,..) returns a list of values formatted according to format string fmt
sub(r,s) substitutes s for first r in current record, returns number of substitutions
sub(r,s,t) substitutes s for first r in t, returns number of substitutions
substr(s,p) returns suffix of s starting at position p
substr(s,p,n) returns substring of s of length n starting at position p
tolower(s) returns s translated into lowercase
toupper(s) returns s translated into uppercase