@@ -97,20 +97,20 @@ module stdlib_strings
97
97
! > [Specifications](link to the specs - to be completed)
98
98
! > Version: experimental
99
99
interface padl
100
- module procedure :: padl_string_string
101
- module procedure :: padl_string_char
102
- module procedure :: padl_char_string
103
- module procedure :: padl_char_char
100
+ module procedure :: padl_string_default
101
+ module procedure :: padl_string_pad_with
102
+ module procedure :: padl_char_default
103
+ module procedure :: padl_char_pad_with
104
104
end interface padl
105
105
106
106
! > Right pad the input string
107
107
! > [Specifications](link to the specs - to be completed)
108
108
! > Version: experimental
109
109
interface padr
110
- module procedure :: padr_string_string
111
- module procedure :: padr_string_char
112
- module procedure :: padr_char_string
113
- module procedure :: padr_char_char
110
+ module procedure :: padr_string_default
111
+ module procedure :: padr_string_pad_with
112
+ module procedure :: padr_char_default
113
+ module procedure :: padr_char_pad_with
114
114
end interface padr
115
115
116
116
contains
@@ -672,38 +672,48 @@ end function replace_all_char_char_char
672
672
! > Left pad the input string with the 'pad_with' string
673
673
! >
674
674
! > Returns a new string
675
- pure function padl_string_string (string , output_length , pad_with ) result(res)
675
+ pure function padl_string_default (string , output_length ) result(res)
676
676
type (string_type), intent (in ) :: string
677
677
integer , intent (in ) :: output_length
678
- type (string_type), intent (in ) :: pad_with
679
678
type (string_type) :: res
680
679
681
- res = string_type(padl_char_char(char (string), output_length, char (pad_with) ))
682
- end function padl_string_string
680
+ res = string_type(padl_char_char(char (string), output_length, " " ))
681
+ end function padl_string_default
683
682
684
683
! > Left pad the input string with the 'pad_with' string
685
684
! >
686
685
! > Returns a new string
687
- pure function padl_string_char (string , output_length , pad_with ) result(res)
686
+ pure function padl_string_pad_with (string , output_length , pad_with ) result(res)
688
687
type (string_type), intent (in ) :: string
689
688
integer , intent (in ) :: output_length
690
689
character (len= 1 ), intent (in ) :: pad_with
691
690
type (string_type) :: res
692
691
693
692
res = string_type(padl_char_char(char (string), output_length, pad_with))
694
- end function padl_string_char
693
+ end function padl_string_pad_with
695
694
696
695
! > Left pad the input string with the 'pad_with' string
697
696
! >
698
697
! > Returns a new string
699
- pure function padl_char_string (string , output_length , pad_with ) result(res)
698
+ pure function padl_char_default (string , output_length ) result(res)
700
699
character (len=* ), intent (in ) :: string
701
700
integer , intent (in ) :: output_length
702
- type (string_type), intent (in ) :: pad_with
703
701
character (len= max (len (string), output_length)) :: res
704
702
705
- res = padl_char_char(string, output_length, char (pad_with))
706
- end function padl_char_string
703
+ res = padl_char_char(string, output_length, " " )
704
+ end function padl_char_default
705
+
706
+ ! > Left pad the input string with the 'pad_with' string
707
+ ! >
708
+ ! > Returns a new string
709
+ pure function padl_char_pad_with (string , output_length , pad_with ) result(res)
710
+ character (len=* ), intent (in ) :: string
711
+ integer , intent (in ) :: output_length
712
+ character (len= 1 ), intent (in ) :: pad_with
713
+ character (len= max (len (string), output_length)) :: res
714
+
715
+ res = padl_char_char(string, output_length, pad_with)
716
+ end function padl_char_pad_with
707
717
708
718
! > Left pad the input string with the 'pad_with' string
709
719
! >
@@ -729,38 +739,48 @@ end function padl_char_char
729
739
! > Right pad the input string with the 'pad_with' string
730
740
! >
731
741
! > Returns a new string
732
- pure function padr_string_string (string , output_length , pad_with ) result(res)
742
+ pure function padr_string_default (string , output_length ) result(res)
733
743
type (string_type), intent (in ) :: string
734
744
integer , intent (in ) :: output_length
735
- type (string_type), intent (in ) :: pad_with
736
745
type (string_type) :: res
737
746
738
- res = string_type(padr_char_char(char (string), output_length, char (pad_with) ))
739
- end function padr_string_string
747
+ res = string_type(padr_char_char(char (string), output_length, " " ))
748
+ end function padr_string_default
740
749
741
750
! > Right pad the input string with the 'pad_with' string
742
751
! >
743
752
! > Returns a new string
744
- pure function padr_string_char (string , output_length , pad_with ) result(res)
753
+ pure function padr_string_pad_with (string , output_length , pad_with ) result(res)
745
754
type (string_type), intent (in ) :: string
746
755
integer , intent (in ) :: output_length
747
756
character (len= 1 ), intent (in ) :: pad_with
748
757
type (string_type) :: res
749
758
750
759
res = string_type(padr_char_char(char (string), output_length, pad_with))
751
- end function padr_string_char
760
+ end function padr_string_pad_with
752
761
753
762
! > Right pad the input string with the 'pad_with' string
754
763
! >
755
764
! > Returns a new string
756
- pure function padr_char_string (string , output_length , pad_with ) result(res)
765
+ pure function padr_char_default (string , output_length ) result(res)
757
766
character (len=* ), intent (in ) :: string
758
767
integer , intent (in ) :: output_length
759
- type (string_type), intent (in ) :: pad_with
760
768
character (len= max (len (string), output_length)) :: res
761
769
762
- res = padr_char_char(string, output_length, char (pad_with))
763
- end function padr_char_string
770
+ res = padr_char_char(string, output_length, " " )
771
+ end function padr_char_default
772
+
773
+ ! > Right pad the input string with the 'pad_with' string
774
+ ! >
775
+ ! > Returns a new string
776
+ pure function padr_char_pad_with (string , output_length , pad_with ) result(res)
777
+ character (len=* ), intent (in ) :: string
778
+ integer , intent (in ) :: output_length
779
+ character (len= 1 ), intent (in ) :: pad_with
780
+ character (len= max (len (string), output_length)) :: res
781
+
782
+ res = padr_char_char(string, output_length, pad_with)
783
+ end function padr_char_pad_with
764
784
765
785
! > Right pad the input string with the 'pad_with' character
766
786
! >
0 commit comments