libSUFR
a LIBrary of Some Useful Fortran Routines
All Classes Namespaces Files Functions Variables Pages
text.f90 File Reference

(libSUFR version 0.7.8, revision 407, hash 01069b8, 2025-03-02)

Procedures to manipulate text/strings. More...

Go to the source code of this file.

Modules

module  sufr_text
 Procedures to manipulate text/strings.
 

Functions/Subroutines

pure character function, dimension(len(str)) sufr_text::lowercase (str)
 Make a string lower case.
 
pure character function, dimension(len(str)) sufr_text::uppercase (str)
 Make a string upper case.
 
pure character function, dimension(len(str)) sufr_text::uppercaseinitial (str)
 Make a string lower case with an upper-case initial.
 
pure character function, dimension((len(str16)+1)/2) sufr_text::utf16to8 (str16)
 Convert a UTF-16 string to UTF-8.
 
pure subroutine sufr_text::replace_substring (string, str_srch, str_repl)
 Search and replace occurences of a substring in a string as often as the search string is found.
 
subroutine sufr_text::remove_substring (string, substr, debug)
 Remove a substring from a string, if present.
 
integer function sufr_text::count_substring (string, substr)
 Count how many times a substring is present in a string.
 
subroutine sufr_text::replace_string_in_textfile (file_in, file_out, str_srch, str_repl, status)
 Search and replace occurences of a string in a text file. Lines up to 9999 characters only, otherwise a warning is given.
 
pure logical function sufr_text::string_contains_one_of (string, characters)
 Verify whether a string contains any of a given list of characters.
 
pure character function, dimension(max(number, 1)) sufr_text::tabs (number)
 Print multiple tab characters.
 
pure character function, dimension(sign(1, number) -1) sufr_text::int2str (number)
 Convert an integer to a character string of the proper length.
 
pure character function, dimension(sign(1_long, floor(number, long)) -1) sufr_text::dbl2str (number, decim, mark)
 Convert a double-precision real to a nice character string. Difference with the F0 format descriptor: replace leading . or -. with 0. and -0. respectively (0.1 iso .1; -0.1 iso -.1).
 
pure character function, dimension(sign(1_long, floor(number, long)) -1) sufr_text::d2s (number, decim, mark)
 Convert a double-precision real to a nice character string. Short alias for dbl2str().
 
pure character function, dimension(sign(1_long, floor(number, long)) -1) sufr_text::d2sc (number, decim)
 Convert a double-precision real to a nice character string using a comma as decimal mark. Alias for dbl2str(number, decim, ',').
 
pure character function, dimension(sign(1, floor(number)) -1) sufr_text::real2str (number, decim, mark)
 Convert a single-precision real to a nice character string. Single-precision wrapper for dbl2str.
 

Detailed Description

Procedures to manipulate text/strings.

Definition in file text.f90.