rchop Function

public pure function rchop(str, chars) result(newstr)

Chop trailing chars string from str. Note that trailing spaces are not ignored in either string.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

original string

character(len=*), intent(in) :: chars

characters to strip

Return Value character(len=:), allocatable

new string


Calls

proc~~rchop~~CallsGraph proc~rchop rchop proc~lchop lchop proc~rchop->proc~lchop proc~reverse reverse proc~rchop->proc~reverse

Source Code

    pure function rchop(str, chars) result(newstr)

    character(len=*),intent(in) :: str  !! original string
    character(len=*),intent(in) :: chars !! characters to strip
    character(len=:),allocatable :: newstr !! new string

    newstr = reverse(lchop(reverse(str), reverse(chars)))

    end function rchop