Manual Reference Pages  - lower_quoted (3m_strings)

NAME

lower_quoted(3f) - [M_strings:CASE] elemental function converts string to lowercase skipping strings quoted per Fortran syntax rules (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Examples
See Also
Author
License

SYNOPSIS

elemental pure function lower_quoted(str) result (string)

    character(*), intent(in)    :: str
    character(len(str))         :: string  ! output string

DESCRIPTION

lower_quoted(string) returns a copy of the input string with all not-quoted characters converted to lowercase, assuming ASCII character sets are being used. The quoting rules are the same as for Fortran source. Either a single or double quote starts a quoted string, and a quote character of the same type is doubled when it appears internally in the quoted string. If a double quote quotes the string single quotes may appear in the quoted string as single characters, and vice-versa for single quotes.

OPTIONS

str string to convert to lowercase

RETURNS

lower copy of the input string with all unquoted characters converted to lowercase

EXAMPLES

Sample program:

    program demo_lower_quoted
    use M_strings, only: lower_quoted
    implicit none
    character(len=:),allocatable  :: s
    s=’ ABCDEFG abcdefg "Double-Quoted" ’’Single-Quoted’’ "with ""&
       & Quote" everything else’
       write(*,*) ’mixed-case input string is ....’,s
       write(*,*) ’lower-case output string is ...’,lower_quoted(s)
       write(*,’(1x,a,*(a:,"+"))’) ’lower_quoted(3f) is elemental ==>’, &
       & lower_quoted(["abc","def","ghi"])
    end program demo_lower_quoted

Results:

 >  mixed-case input string is .... ABCDEFG abcdefg "Double-Quoted" ...
    ... ’Single-Quoted’ "with "" Quote" everything else
 >  lower-case output string is ... abcdefg abcdefg "Double-Quoted" ...
    ... ’Single-Quoted’ "with "" Quote" everything else
 >  lower_quoted(3f) is elemental ==>abc+def+ghi

SEE ALSO

flower(1)

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 lower_quoted (3m_strings) January 10, 2025
Generated by manServer 1.08 from ab8f40e7-78ca-40e8-9679-852b88ced03e using man macros.