Return a string with all lowercase characters.
type(string) :: astring
logical :: test_passed(1)
astring = 'Hello WorLD!'
test_passed(1) = astring%lower()//''=='hello world!'
print '(L1)', all(test_passed)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(string), | intent(in) | :: | self |
The string. |
Upper case string.
elemental function lower(self) !< Return a string with all lowercase characters. !< !<```fortran !< type(string) :: astring !< logical :: test_passed(1) !< astring = 'Hello WorLD!' !< test_passed(1) = astring%lower()//''=='hello world!' !< print '(L1)', all(test_passed) !<``` !=> T <<< class(string), intent(in) :: self !< The string. type(string) :: lower !< Upper case string. integer :: n1 !< Characters counter. integer :: n2 !< Characters counter. if (allocated(self%raw)) then lower = self do n1=1, len(self%raw) n2 = index(UPPER_ALPHABET, self%raw(n1:n1)) if (n2>0) lower%raw(n1:n1) = LOWER_ALPHABET(n2:n2) enddo endif endfunction lower