Skip to content

Extend stdlib_ascii logical functions to character strings #321

Open
@awvwgk

Description

@awvwgk

Currently most routines provided by stdlib_ascii are only applicable to single characters. The conversion (to_lower and to_upper) routines were straight-forward to extend to character strings (see #310). For the logical functions it is a bit more complicated.

For each of the logical functions (is_ascii, ...) two possible reductions apply: any and all. To follow the Fortran naming of the verify and scan intrinsic` one could implement three versions for each logical function:

  • single character version: is_ascii
  • fixed length character version with any reduction: verify_ascii (empty string returns .false.)
  • fixed length character version with all reduction: scan_ascii (empty string returns .true.)

Alternatively, to be more in line with the verify and scan function, the index of the first matching character could be returned, which makes it easy to create the respective logical by a simple comparison.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaProposition of an idea and opening an issue to discuss ittopic: stringsString processing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions