We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 186f048 commit fd6a1a5Copy full SHA for fd6a1a5
test/test.f90
@@ -7,9 +7,14 @@ program test
7
logical :: l1
8
9
c1="My name is Tony Stark. Tony Stark is Iron Man."
10
- !print *,"MYSTRING = ",c1
11
i1=str_count(c1,"Tony")
12
- !print *,"COUNT OF SPACES = ",i1
+ if(i1.ne.2)call exit(1)
+ i1=str_count(c1,"Tony",match_case=.true.)
13
14
+ i1=str_count(c1,"TONY",match_case=.false.)
15
16
+ i1=str_count(c1,"tony",match_case=.true.)
17
+ if(i1.ne.0)call exit(1)
18
19
c1=str_replace(c1,"Tony Stark","Steve Rogers")
20
!print *,"MYSTRING = ",c1
@@ -68,5 +73,12 @@ program test
68
73
l1=str_test(c1,"Vision") ! FALSE
69
74
!print *,l1
70
75
if(l1)call exit(1)
76
+ l1=str_test(c1,"THOR",match_case=.true.) ! False
77
+ if(l1)call exit(1)
78
+ l1=str_test(c1,"THOR",match_case=.false.) ! True
79
+ if(.not.l1)call exit(1)
80
+
81
+ c1="Ironman,Thor,Thanos,Black Panther,Winter Soldier"
82
+ if(str_swapcase(str_swapcase(c1)).ne.c1)call exit(1)
71
83
72
84
end program test
0 commit comments