@@ -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
@@ -587,38 +587,48 @@ end function replace_all_char_char_char
587
587
! > Left pad the input string with the 'pad_with' string
588
588
! >
589
589
! > Returns a new string
590
- pure function padl_string_string (string , output_length , pad_with ) result(res)
590
+ pure function padl_string_default (string , output_length ) result(res)
591
591
type (string_type), intent (in ) :: string
592
592
integer , intent (in ) :: output_length
593
- type (string_type), intent (in ) :: pad_with
594
593
type (string_type) :: res
595
594
596
- res = string_type(padl_char_char(char (string), output_length, char (pad_with) ))
597
- end function padl_string_string
595
+ res = string_type(padl_char_char(char (string), output_length, " " ))
596
+ end function padl_string_default
598
597
599
598
! > Left pad the input string with the 'pad_with' string
600
599
! >
601
600
! > Returns a new string
602
- pure function padl_string_char (string , output_length , pad_with ) result(res)
601
+ pure function padl_string_pad_with (string , output_length , pad_with ) result(res)
603
602
type (string_type), intent (in ) :: string
604
603
integer , intent (in ) :: output_length
605
604
character (len= 1 ), intent (in ) :: pad_with
606
605
type (string_type) :: res
607
606
608
607
res = string_type(padl_char_char(char (string), output_length, pad_with))
609
- end function padl_string_char
608
+ end function padl_string_pad_with
610
609
611
610
! > Left pad the input string with the 'pad_with' string
612
611
! >
613
612
! > Returns a new string
614
- pure function padl_char_string (string , output_length , pad_with ) result(res)
613
+ pure function padl_char_default (string , output_length ) result(res)
615
614
character (len=* ), intent (in ) :: string
616
615
integer , intent (in ) :: output_length
617
- type (string_type), intent (in ) :: pad_with
618
616
character (len= max (len (string), output_length)) :: res
619
617
620
- res = padl_char_char(string, output_length, char (pad_with))
621
- end function padl_char_string
618
+ res = padl_char_char(string, output_length, " " )
619
+ end function padl_char_default
620
+
621
+ ! > Left pad the input string with the 'pad_with' string
622
+ ! >
623
+ ! > Returns a new string
624
+ pure function padl_char_pad_with (string , output_length , pad_with ) result(res)
625
+ character (len=* ), intent (in ) :: string
626
+ integer , intent (in ) :: output_length
627
+ character (len= 1 ), intent (in ) :: pad_with
628
+ character (len= max (len (string), output_length)) :: res
629
+
630
+ res = padl_char_char(string, output_length, pad_with)
631
+ end function padl_char_pad_with
622
632
623
633
! > Left pad the input string with the 'pad_with' string
624
634
! >
@@ -644,38 +654,48 @@ end function padl_char_char
644
654
! > Right pad the input string with the 'pad_with' string
645
655
! >
646
656
! > Returns a new string
647
- pure function padr_string_string (string , output_length , pad_with ) result(res)
657
+ pure function padr_string_default (string , output_length ) result(res)
648
658
type (string_type), intent (in ) :: string
649
659
integer , intent (in ) :: output_length
650
- type (string_type), intent (in ) :: pad_with
651
660
type (string_type) :: res
652
661
653
- res = string_type(padr_char_char(char (string), output_length, char (pad_with) ))
654
- end function padr_string_string
662
+ res = string_type(padr_char_char(char (string), output_length, " " ))
663
+ end function padr_string_default
655
664
656
665
! > Right pad the input string with the 'pad_with' string
657
666
! >
658
667
! > Returns a new string
659
- pure function padr_string_char (string , output_length , pad_with ) result(res)
668
+ pure function padr_string_pad_with (string , output_length , pad_with ) result(res)
660
669
type (string_type), intent (in ) :: string
661
670
integer , intent (in ) :: output_length
662
671
character (len= 1 ), intent (in ) :: pad_with
663
672
type (string_type) :: res
664
673
665
674
res = string_type(padr_char_char(char (string), output_length, pad_with))
666
- end function padr_string_char
675
+ end function padr_string_pad_with
667
676
668
677
! > Right pad the input string with the 'pad_with' string
669
678
! >
670
679
! > Returns a new string
671
- pure function padr_char_string (string , output_length , pad_with ) result(res)
680
+ pure function padr_char_default (string , output_length ) result(res)
672
681
character (len=* ), intent (in ) :: string
673
682
integer , intent (in ) :: output_length
674
- type (string_type), intent (in ) :: pad_with
675
683
character (len= max (len (string), output_length)) :: res
676
684
677
- res = padr_char_char(string, output_length, char (pad_with))
678
- end function padr_char_string
685
+ res = padr_char_char(string, output_length, " " )
686
+ end function padr_char_default
687
+
688
+ ! > Right pad the input string with the 'pad_with' string
689
+ ! >
690
+ ! > Returns a new string
691
+ pure function padr_char_pad_with (string , output_length , pad_with ) result(res)
692
+ character (len=* ), intent (in ) :: string
693
+ integer , intent (in ) :: output_length
694
+ character (len= 1 ), intent (in ) :: pad_with
695
+ character (len= max (len (string), output_length)) :: res
696
+
697
+ res = padr_char_char(string, output_length, pad_with)
698
+ end function padr_char_pad_with
679
699
680
700
! > Right pad the input string with the 'pad_with' character
681
701
! >
0 commit comments