Chop trailing chars string from str.
Note that trailing spaces are not ignored in either string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | str |
original string |
||
| character(len=*), | intent(in) | :: | chars |
characters to strip |
new string
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