@@ -125,4 +125,59 @@ int main(){
125
125
cout << endl;
126
126
127
127
return 0 ;
128
- }
128
+ }
129
+
130
+ /*
131
+ OUTPUT:
132
+
133
+ s0:
134
+ s1: Hello
135
+ s2: Hello World
136
+ s3: Hello World
137
+ s4: Hello World
138
+ s5: abcd
139
+
140
+ s5: string length- 4
141
+
142
+ s0 is an Empty string
143
+
144
+ s0: I love c++
145
+ s0: I love c++and javascript
146
+
147
+ s0: I love c++and javascript
148
+ s0: length before removing- 24
149
+ s0:
150
+ s0: length after removing- 0
151
+
152
+ Comparing string lexically: s1: apple | s2: mango
153
+ s1.compare(s2): -1
154
+ s2.compare(s1): 1
155
+ s1.compare(s1): 0
156
+
157
+ s1: apple | s2: mango
158
+ s1<s2: mango is lexicographic greater than apple
159
+
160
+ s1: apple
161
+ s1[3]: l
162
+
163
+ s1: I want to have orange juice
164
+ index of 'orange': 15
165
+
166
+ s1: I want to have orange juice
167
+ s1: I want to have juice
168
+
169
+
170
+ Using FOR loop: I, ,w,a,n,t, ,t,o, ,h,a,v,e, , ,j,u,i,c,e,
171
+
172
+ FOR loop (using 'auto): I, ,w,a,n,t, ,t,o, ,h,a,v,e, , ,j,u,i,c,e,
173
+
174
+
175
+ Using Iterator: I, ,w,a,n,t, ,t,o, ,h,a,v,e, , ,j,u,i,c,e,
176
+
177
+ Iterator (using auto): I, ,w,a,n,t, ,t,o, ,h,a,v,e, , ,j,u,i,c,e,
178
+
179
+
180
+ FOR EACH loop: I, ,w,a,n,t, ,t,o, ,h,a,v,e, , ,j,u,i,c,e,
181
+
182
+ FOR EACH loop (using 'auto'): I, ,w,a,n,t, ,t,o, ,h,a,v,e, , ,j,u,i,c,e,
183
+ */
0 commit comments