@@ -728,26 +728,6 @@ pure elemental function default_neq_ucs4(def_str,ucs4_str) result(res)
728
728
end function default_neq_ucs4
729
729
! *****************************************************************************************
730
730
731
- ! *****************************************************************************************
732
- ! > author: Jacob Williams
733
- !
734
- ! Return the lowercase version of the `CK` character.
735
-
736
- pure elemental function lowercase_character(c) result(c_lower)
737
-
738
- implicit none
739
-
740
- character (kind= CK,len= 1 ),intent (in ) :: c
741
- character (kind= CK,len= 1 ) :: c_lower
742
-
743
- integer :: i ! ! index in uppercase array
744
-
745
- i = index (upper,c)
746
- c_lower = merge (lower(i:i),c,i> 0 )
747
-
748
- end function lowercase_character
749
- ! *****************************************************************************************
750
-
751
731
! *****************************************************************************************
752
732
! > author: Jacob Williams
753
733
!
@@ -761,23 +741,21 @@ pure elemental function lowercase_string(str) result(s_lower)
761
741
character (kind= CK,len= (len (str))) :: s_lower ! ! lowercase version of the string
762
742
763
743
integer :: i ! ! counter
764
- integer :: n ! ! length of input string
744
+ integer :: j ! ! index of uppercase character
765
745
766
- s_lower = CK_' '
767
- n = len_trim (str)
746
+ s_lower = str
768
747
769
- if (n> 0 ) then
770
- do concurrent (i= 1 :n)
771
- s_lower(i:i) = lowercase_character(str(i:i))
772
- end do
773
- end if
748
+ do i = 1 , len_trim (str)
749
+ j = index (upper,s_lower(i:i))
750
+ if (j> 0 ) s_lower(i:i) = lower(j:j)
751
+ end do
774
752
775
753
end function lowercase_string
776
754
! *****************************************************************************************
777
755
778
756
! *****************************************************************************************
779
757
! >
780
- ! Replace all occurances of `s1` in `str` with `s2`.
758
+ ! Replace all occurrences of `s1` in `str` with `s2`.
781
759
!
782
760
! A case-sensitive match is used.
783
761
!
0 commit comments