Perhaps build a poll asking the importance of different classes of string routines?
I find having basic string functions for splitting strings on delimiters, case conversion, and
converting between numeric and string functions and handling white-space the most essential.
Some example stand-alone modules that are licensed as public domain that could fuel discussion are
Is parsing command line arguments part of this discussion? It is largely the act of parsing a “command” string?
The Stand-alone modules referenced above have their own documention, but I think the following
routines as described in GPF manpages
are pertinent and also cover almost all the stand-alone modules:
-
path (3) - [M_path] OOP interface for a GNU Linux or Unix pathname
-
splitpath (3) - [M_io] split a Unix pathname into components
-
M_list (3) - [M_list] maintain simple lists
-
insert (3) - [M_list] insert entry into a string array at specified position
-
locate (3) - [M_list] finds the index where a string is found or should be in a sorted array
-
remove (3) - [M_list] remove entry from an allocatable array at specified position
-
replace (3) - [M_list] replace entry in a string array at specified position
-
amatch (3) - [M_match] - look for pattern matching regular expression; returns its location
-
match (3) - [M_match] find match anywhere on line
-
omatch (3) - [M_match] try to match a single pattern at pat(j)
-
M_regex (3) - [M_regex] Fortran interface to POSIX 1003.2 regular expression library using ISO_C_BINDING.
-
regcomp (3) - [M_regex] Compile a regular expression into a regex object
-
regerror (3) - [M_regex] maps a non-zero errcode from either regcomp(3) or regexec(3) to a human-readable, printable message.
-
regexec (3) - [M_regex] Execute a compiled regex against a string
-
regfree (3) - [M_regex] Release storage used by the internal form of the RE (Regular Expression)
-
regmatch (3) - [M_regex] return selected substring defined by the MATCHES(2, array
-
regsub (3) - [M_regex] perform regex substitutions
-
describe (3) - [M_strings] returns a string describing the name of a single character
-
msg (3) - [M_strings] converts any standard scalar type to a string
-
rotate13 (3) - [M_strings] apply trivial ROT13 encryption to a string
-
c2s (3) - [M_strings:ARRAY] convert C string pointer to Fortran character string
-
s2c (3) - [M_strings:ARRAY] convert character variable to array of characters with last element set to null
-
switch (3) - [M_strings:ARRAY] converts between CHARACTER scalar and array of single characters
-
base (3) - [M_strings:BASE] convert whole number string in base [2-36] to string in alternate base [2-36]
-
codebase (3) - [M_strings:BASE] convert whole number in base 10 to string in base [2-36]
-
decodebase (3) - [M_strings:BASE] convert whole number string in base [2-36] to base 10 number
-
lower (3) - [M_strings:CASE] changes a string to lowercase over specified range
-
upper (3) - [M_strings:CASE] changes a string to uppercase
-
upper_quoted (3) - [M_strings:CASE] elemental function converts string to miniscule skipping strings quoted per Fortran syntax r
ules
-
isalnum (3) - [M_strings:COMPARE] test membership in subsets of ASCII set
-
matchw (3) - [M_strings:COMPARE] compare given string for match to pattern which may contain wildcard characters
-
change (3) - [M_strings:EDITING] change old string to new string with a directive like a line editor
-
join (3) - [M_strings:EDITING] append CHARACTER variable array into a single CHARACTER variable with specified separator
-
modif (3) - [M_strings:EDITING] emulate the MODIFY command from the line editor XEDIT
-
replace (3) - [M_strings:EDITING] function globally replaces one substring for another in string
-
reverse (3) - [M_strings:EDITING] Return a string reversed
-
substitute (3) - [M_strings:EDITING] subroutine globally substitutes one substring for another in string
-
transliterate (3) - [M_strings:EDITING] replace characters from old set with new set
-
M_strings (3) - [M_strings:INTRO] Fortran string modu+ len_white (3) - [M_strings:LENGTH] get length of string trimmed of whitespace.
-
lenset (3) - [M_strings:LENGTH] return string trimmed or padded to specified length
-
merge_str (3) - [M_strings:LENGTH] pads strings to same length and then calls MERGE(3f)
-
stretch (3) - [M_strings:LENGTH] return string padded to at least specified length
-
expand (3) - [M_strings:NONALPHA] expand C-like escape sequences
-
noesc (3) - [M_strings:NONALPHA] convert non-printable characters to a space.
-
notabs (3) - [M_strings:NONALPHA] expand tab characters
-
visible (3) - [M_strings:NONALPHA] expand a string to control and meta-control representations
-
getvals (3) - [M_strings:NUMERIC] read arbitrary number of REAL values from a character variable up to size of VALUES() array
-
isnumber (3) - [M_strings:NUMERIC] determine if a string represents a number
-
listout (3) - [M_strings:NUMERIC] expand a list of numbers where negative numbers denote range ends (1 -10 means 1 thru 10)
-
s2v (3) - [M_strings:NUMERIC] function returns doubleprecision numeric value from a string
-
s2vs (3) - [M_strings:NUMERIC] given a string representing numbers return a numeric array
-
string_to_value (3) - [M_strings:NUMERIC] subroutine returns numeric value from string
-
string_to_values (3) - [M_strings:NUMERIC] read a string representing numbers into a numeric array
-
v2s (3) - [M_strings:NUMERIC] return numeric string from a numeric value
-
value_to_string (3) - [M_strings:NUMERIC] return numeric string from a numeric value
-
quote (3) - [M_strings:QUOTES] add quotes to string as if written with list-directed input
-
unquote (3) - [M_strings:QUOTES] remove quotes from string as if read with list-directed input
-
chomp (3) - [M_strings:TOKENS] Tokenize a string, consuming it one token per call
-
delim (3) - [M_strings:TOKENS] parse a string and store tokens into an array
-
fmt (3) - [M_strings:TOKENS] convert text to a paragraph
-
split (3) - [M_strings:TOKENS] parse string into an array using specified delimiters
-
strtok (3) - [M_strings:TOKENS] Tokenize a string
-
adjustc (3) - [M_strings:WHITESPACE] center text
-
compact (3) - [M_strings:WHITESPACE] converts contiguous whitespace to a single character (or nothing)
-
crop (3) - [M_strings:WHITESPACE] trim leading blanks and trailing blanks from a string
-
indent (3) - [M_strings:WHITESPACE] count number of leading spaces in a string
-
nospace (3) - [M_strings:WHITESPACE] remove all whitespace from input string