1
00:00:02,760 --> 00:00:03,450
Hi, everyone.

2
00:00:03,460 --> 00:00:06,930
So in this lesson, we are going to learn what is a string class.

3
00:00:08,350 --> 00:00:14,320
So we started about object oriented programming and we know what is the meaning of a class, so stringers

4
00:00:14,320 --> 00:00:18,470
and world class, but we can use a string as if it is a data type.

5
00:00:19,600 --> 00:00:20,910
So what do I mean by that?

6
00:00:21,460 --> 00:00:24,340
So basically what you can do, you can write something like this.

7
00:00:24,940 --> 00:00:26,410
String did a type.

8
00:00:26,890 --> 00:00:29,470
The name is S and let's say ABC.

9
00:00:31,170 --> 00:00:33,620
So here String is behaving as a day to day.

10
00:00:33,780 --> 00:00:40,080
That's why I told you that we can use a string as a leader type symbol, so we'll string actually behaves

11
00:00:40,080 --> 00:00:41,100
like the correct.

12
00:00:42,270 --> 00:00:44,860
But what is the problem with the character?

13
00:00:45,000 --> 00:00:48,570
So the problem is basically we have to always take care of character.

14
00:00:49,500 --> 00:00:56,550
So this character, but this is not the problem with strings, so let's see how we can use the strings.

15
00:01:00,350 --> 00:01:01,760
So let us create a string.

16
00:01:05,540 --> 00:01:10,700
String, as let's say it, is containing ABC and then you can bring to a string.

17
00:01:13,980 --> 00:01:14,610
So let's see.

18
00:01:18,820 --> 00:01:20,680
So ABC is getting printed.

19
00:01:26,580 --> 00:01:29,100
Now, you can also do like this.

20
00:01:30,510 --> 00:01:33,870
So let us create one more string string as to.

21
00:01:35,680 --> 00:01:39,240
And you can ride like this so as to is the E.F..

22
00:01:40,620 --> 00:01:42,330
And now let us bring as to.

23
00:01:48,120 --> 00:01:49,560
So ABC and the.

24
00:01:51,980 --> 00:01:54,680
So basically, you can also create a lasting dynamic.

25
00:01:54,860 --> 00:01:59,150
So here we are creating strings statically, let us know, create string dynamically.

26
00:02:00,690 --> 00:02:04,710
So a string start, string pointer, this is new string.

27
00:02:07,990 --> 00:02:10,750
And now let us give the values star SB.

28
00:02:11,830 --> 00:02:12,880
Let's say it is.

29
00:02:14,790 --> 00:02:15,480
Aminul.

30
00:02:19,130 --> 00:02:24,410
Now, what will remain output vibrant, Espie, so the output will be addressed if you want to print

31
00:02:24,410 --> 00:02:24,960
the content.

32
00:02:24,980 --> 00:02:26,960
You have to use star status S.B.

33
00:02:28,360 --> 00:02:31,000
And then you will get the content, so let's see.

34
00:02:37,660 --> 00:02:43,210
So this is the address and this is the content, so you have to give state of footprinting the content

35
00:02:43,510 --> 00:02:47,730
and if you will not give the defense operator, it will print the address.

36
00:02:48,340 --> 00:02:50,680
So addresses is stored in hexadecimal format.

37
00:02:53,290 --> 00:03:00,100
Now, suppose you want to store multiple strings, so in that case, if you do not know, how will store

38
00:03:00,100 --> 00:03:03,540
multiple strings, so you have to create a truly array of characters.

39
00:03:04,000 --> 00:03:10,060
So get a and then you have to create a truly array of characters under the cross hundred.

40
00:03:11,060 --> 00:03:17,540
And in this one, Red Cross and Red, basically your first instinct will be stored here, 029 Grain,

41
00:03:17,690 --> 00:03:20,150
then your second string, then your third string and so on.

42
00:03:20,480 --> 00:03:22,160
So this is not a good way.

43
00:03:22,640 --> 00:03:26,870
The good ways, what you can do, you can write that rough string.

44
00:03:27,940 --> 00:03:31,100
String is going to behave as a day to day so you can write like this.

45
00:03:31,480 --> 00:03:32,320
So what will happen?

46
00:03:32,620 --> 00:03:33,640
You will get a vector.

47
00:03:35,000 --> 00:03:38,630
And each and every of vector is basically a string.

48
00:03:40,510 --> 00:03:42,870
So each and every effect is going to be testing.

49
00:03:44,260 --> 00:03:51,220
So this thing is much, much powerful than this tutelary, because you are using string and you're also

50
00:03:51,220 --> 00:03:51,920
using vector.

51
00:03:51,940 --> 00:03:57,280
So basically you have power of a string function, all the function of string class, and you have power

52
00:03:57,280 --> 00:03:59,050
of all the function of the vector class.

53
00:04:00,430 --> 00:04:07,510
So let's see, so let us create a duty area so suffocating the judiciary, we will always ride like

54
00:04:07,510 --> 00:04:13,090
this, testing we and for pushing one element, what the hell do you have to push a string?

55
00:04:13,420 --> 00:04:17,560
So let us push the content so we don't push back.

56
00:04:18,890 --> 00:04:23,090
Let's say I want to insert this string as so we don't push back.

57
00:04:23,120 --> 00:04:23,950
You can write this.

58
00:04:25,670 --> 00:04:27,150
Let us insert one more thing.

59
00:04:27,230 --> 00:04:28,190
Let's say we don't.

60
00:04:29,780 --> 00:04:30,410
Pushback.

61
00:04:33,630 --> 00:04:34,020
Hello.

62
00:04:35,330 --> 00:04:41,320
And similarly, you can print the content, so for printing the content, you just have to get rid of

63
00:04:41,330 --> 00:04:41,910
a director.

64
00:04:42,770 --> 00:04:45,500
So I call zero a list and we dot size.

65
00:04:46,890 --> 00:04:48,360
So, Victor, I say function.

66
00:04:49,870 --> 00:04:58,210
And then you can print the content so we have a BFA is actually a string, so let's see.

67
00:05:00,140 --> 00:05:01,880
OK, so we have to include Victor.

68
00:05:14,270 --> 00:05:18,290
So you can see ABC is this one, and then we started hello.

69
00:05:19,040 --> 00:05:21,770
So Victor Offspring is behaving as a truly very.

70
00:05:26,310 --> 00:05:28,280
OK, so what else can we do?

71
00:05:29,700 --> 00:05:33,290
So you are inserting the elements, you can also call the function site.

72
00:05:34,140 --> 00:05:37,440
So when you first you print this element, then let's start.

73
00:05:37,950 --> 00:05:42,080
So how you will sort be of a so what is view of a is a string.

74
00:05:42,540 --> 00:05:44,460
So you will give the Eurofighter begin.

75
00:05:45,940 --> 00:05:50,710
And you will give B of A is a string, so you will give V of a dot and.

76
00:05:52,570 --> 00:05:54,910
And now let us sprint, we offer you again.

77
00:06:07,010 --> 00:06:08,010
Let's see what is there.

78
00:06:08,060 --> 00:06:09,900
So it was not declared in this scope.

79
00:06:09,940 --> 00:06:15,020
OK, so this site function, this will function is declared in algorithm liablity.

80
00:06:16,200 --> 00:06:19,260
So let us include that library also.

81
00:06:25,070 --> 00:06:26,240
Now, later, up around.

82
00:06:32,710 --> 00:06:40,450
So ABC, after citing ABC, it is still ABC because the AlphaBeta sorted according to the lexicographical

83
00:06:40,470 --> 00:06:40,860
minus.

84
00:06:41,200 --> 00:06:43,140
So after sorting.

85
00:06:43,840 --> 00:06:45,370
So what is happening here?

86
00:06:47,440 --> 00:06:49,150
So first hosting was ABC.

87
00:06:49,900 --> 00:06:56,380
So if you will start ABC, then it will become ABC only because it is less than beebees, less dense.

88
00:06:56,500 --> 00:06:58,680
So in this way, the alphabet's are getting started.

89
00:06:59,110 --> 00:07:00,570
Now, if you want to start.

90
00:07:00,610 --> 00:07:00,980
Hello.

91
00:07:01,810 --> 00:07:03,010
So which one is the smallest.

92
00:07:03,070 --> 00:07:04,330
So is the smallest.

93
00:07:04,340 --> 00:07:12,100
So you will come out first, then each, then similarly l.n. and then or so after sorting hello will

94
00:07:12,100 --> 00:07:13,530
become this one.

95
00:07:13,900 --> 00:07:15,970
So basically you can start your tutelary.

96
00:07:17,370 --> 00:07:20,500
What we are doing, we can sort our character to really.

97
00:07:20,550 --> 00:07:23,180
So if you want to sort of get to the area, it will be difficult.

98
00:07:23,190 --> 00:07:29,670
But let's see, it is so much easier if you are using the crusting for creating a truly array of characters.

99
00:07:34,100 --> 00:07:41,270
Now, let's do some more functions of string so we can take input, so we're taking input, let us create

100
00:07:41,270 --> 00:07:47,480
one more string s three, so string three and we can take input.

101
00:07:47,480 --> 00:07:51,620
So seen as three and let us also print as three.

102
00:07:58,820 --> 00:08:03,950
So it is waiting for my input, let's say the input escorting and the output is calling.

103
00:08:05,390 --> 00:08:07,100
Let's put out one more time.

104
00:08:09,180 --> 00:08:10,930
So, again, it is waiting for my input.

105
00:08:10,950 --> 00:08:15,000
Let's say the input is due space according.

106
00:08:15,980 --> 00:08:20,850
But this time it is taking only do so, we have seen this problem before.

107
00:08:20,890 --> 00:08:22,490
Also, what is the problem?

108
00:08:22,500 --> 00:08:29,150
So the problem is due to in seeing is creating all the problems, because scene will stop taking your

109
00:08:29,150 --> 00:08:31,220
input as soon as it will encounter space.

110
00:08:32,610 --> 00:08:33,450
Or Tab's.

111
00:08:34,740 --> 00:08:36,360
I basically newline character.

112
00:08:37,710 --> 00:08:43,650
So this is saying is the problem in this case now, if you remember, what is the solution?

113
00:08:43,650 --> 00:08:46,320
So the solution is using the function, seeing not getline.

114
00:08:47,530 --> 00:08:54,580
Now, this function seemed odd, getlin function takes three parameters as input string name, the second

115
00:08:54,580 --> 00:09:00,790
one is size and the third parameter is actually optional, which is Delimiter if you remember.

116
00:09:01,990 --> 00:09:09,220
Now, in this case, so this was the situation when we were using correct theory, but here what we

117
00:09:09,220 --> 00:09:10,680
are using, we are using strings.

118
00:09:11,140 --> 00:09:13,150
So what I will write a scene or gridline.

119
00:09:15,490 --> 00:09:15,940
S.

120
00:09:15,940 --> 00:09:19,930
S is basically my string now, the third barometer's option, but what about the second parameter?

121
00:09:19,960 --> 00:09:20,780
What about size?

122
00:09:21,760 --> 00:09:23,860
So this is the property of a stingless.

123
00:09:25,060 --> 00:09:26,530
That you do not know the size.

124
00:09:26,560 --> 00:09:28,700
Basically, you can give anything as input.

125
00:09:28,960 --> 00:09:30,520
You do not have to worry about it.

126
00:09:30,850 --> 00:09:33,660
So basically I cannot use seemed guideline function.

127
00:09:34,030 --> 00:09:34,960
So let me show you.

128
00:09:37,970 --> 00:09:43,910
So instead of saying something is wrong, if I will use Signor Getline function.

129
00:09:45,670 --> 00:09:52,800
S3 now the second parameter is actually size, but we do not know the size, it is the property of the

130
00:09:52,850 --> 00:09:56,500
string class that is the advantage of the stingless.

131
00:09:56,500 --> 00:09:58,420
Basically, you can give anything as input.

132
00:09:58,450 --> 00:10:00,020
You do not have to worry about size.

133
00:10:00,040 --> 00:10:01,800
You do not have to worry about character.

134
00:10:02,230 --> 00:10:05,380
So that means I cannot use Syndergaard name function.

135
00:10:06,490 --> 00:10:08,470
So for stingless we have the function.

136
00:10:09,190 --> 00:10:11,110
We will write it like this getline.

137
00:10:11,590 --> 00:10:14,710
They can put something and put the input in S3.

138
00:10:15,970 --> 00:10:20,410
So this is the way for taking input, for taking input of space.

139
00:10:20,410 --> 00:10:22,150
Kind spaces will be there.

140
00:10:22,480 --> 00:10:28,360
So I have to write like this getline take input from scene and put the input in S3.

141
00:10:28,360 --> 00:10:29,080
So Lozzi.

142
00:10:30,810 --> 00:10:39,630
Now, this time, if you will give and would like do space cording, so our output is correct.

143
00:10:39,660 --> 00:10:44,450
OK, so this is working now, so you have to use Getline and you can remember this.

144
00:10:44,460 --> 00:10:45,770
And it is very simple.

145
00:10:45,790 --> 00:10:46,320
Syntex.

146
00:10:49,010 --> 00:10:53,020
So you do not have to worry about the length of this thing, you do not have to worry about the little

147
00:10:53,060 --> 00:10:53,560
character.

148
00:10:54,080 --> 00:10:55,840
So everything is working perfectly fine.

149
00:10:56,480 --> 00:10:59,640
Now you can treat string's as if it is an eddy.

150
00:10:59,840 --> 00:11:00,950
So what do I mean by that?

151
00:11:01,940 --> 00:11:09,310
So after taking the input, let's say I want to change my string so I can write like this as trees.

152
00:11:09,320 --> 00:11:11,240
Let's say it is.

153
00:11:14,110 --> 00:11:17,420
ABC, ABC, later, this is my news.

154
00:11:18,430 --> 00:11:22,780
So what do I mean by that so you can access it like this?

155
00:11:23,320 --> 00:11:24,980
What is the first character?

156
00:11:25,000 --> 00:11:26,740
What is the character presented?

157
00:11:26,740 --> 00:11:27,590
The first index.

158
00:11:28,210 --> 00:11:30,880
So it will be B, so let's see.

159
00:11:34,660 --> 00:11:36,530
OK, so it is waiting for my input.

160
00:11:36,550 --> 00:11:42,100
So do quoting now, the first character is actually being widescreen because after taking the input

161
00:11:42,100 --> 00:11:44,230
from the user, you are changing the value of S3.

162
00:11:44,230 --> 00:11:50,110
It is ABC, ABC and the first character is actually B, so you can read your strings.

163
00:11:50,110 --> 00:11:53,890
Like if it is an integer like it, like it is an eddy.

164
00:11:55,500 --> 00:11:59,370
So it will ask me for the input again and again, so let us come into out.

165
00:12:01,720 --> 00:12:03,270
Let us also point out this line.

166
00:12:06,730 --> 00:12:13,690
OK, so if we can access that, obviously, I mean, you can change the value also, so let us change

167
00:12:13,690 --> 00:12:14,130
the value.

168
00:12:15,160 --> 00:12:20,080
So let us change the 08 character, the character person to zero.

169
00:12:20,100 --> 00:12:24,370
Next, let's say I want to make a deal so we can definitely do it.

170
00:12:24,370 --> 00:12:26,430
We can do testing as if it is energy.

171
00:12:26,890 --> 00:12:29,620
And now let us sprint as three.

172
00:12:37,460 --> 00:12:40,010
So the zeroth character has been changed.

173
00:12:40,040 --> 00:12:47,650
It was initially, now it is so DBC and ABC, you can see so this is BBC and ABC.

174
00:12:47,660 --> 00:12:49,990
So my character is now the.

175
00:12:53,430 --> 00:12:56,740
So what else can we do so we can add two things?

176
00:12:56,910 --> 00:12:58,360
So what is the meaning of two strings?

177
00:12:58,380 --> 00:12:59,930
What is the meaning of adding two things?

178
00:13:00,330 --> 00:13:03,750
So let us create one most things together and you can write it like this.

179
00:13:04,590 --> 00:13:05,400
String three.

180
00:13:06,460 --> 00:13:17,440
Plus, so this is stingless, so let's add these two stings, so sting three plus string, as do we

181
00:13:17,440 --> 00:13:19,090
have another string, OK?

182
00:13:19,120 --> 00:13:21,720
So let's take it as to silly string.

183
00:13:22,900 --> 00:13:25,990
So as for this history lessons to know what will happen.

184
00:13:26,320 --> 00:13:29,920
So these two things will get added and the output will be stored in a sting.

185
00:13:29,920 --> 00:13:32,880
Asfour So let us write it like this.

186
00:13:32,910 --> 00:13:33,850
So as for.

187
00:13:35,560 --> 00:13:37,660
And let us also bring to to industry.

188
00:13:39,810 --> 00:13:40,860
So as to.

189
00:13:46,290 --> 00:13:46,860
As three.

190
00:14:02,390 --> 00:14:03,910
So let's cut it from here.

191
00:14:08,520 --> 00:14:09,780
And let's be heard here.

192
00:14:17,760 --> 00:14:22,030
OK, so I'm using this plus operator to add a string S3 and string as to.

193
00:14:22,530 --> 00:14:27,900
So this is your string as to which is the ITF and this is your string.

194
00:14:29,130 --> 00:14:31,010
So this is ABC, ABC.

195
00:14:31,020 --> 00:14:32,490
So let's see what will be our output.

196
00:14:35,480 --> 00:14:37,610
OK, so let's come and get out.

197
00:14:38,690 --> 00:14:41,420
Let's remove Sting, let's put this call about.

198
00:14:57,670 --> 00:14:57,890
The.

199
00:14:59,520 --> 00:15:05,490
So you are printing as you got printing a story and you are printing Asfour, so what is as true as

200
00:15:05,610 --> 00:15:09,890
is you can see the ECF so as to his beef, what is a three?

201
00:15:09,900 --> 00:15:18,510
So it is ABC, ABC and you are changing this character to the still string three is actually BBC and

202
00:15:18,510 --> 00:15:19,230
ABC.

203
00:15:20,470 --> 00:15:26,620
And then what they are doing so is three plus S2, so this plus operating what it will do, so three

204
00:15:27,190 --> 00:15:28,060
plus S2.

205
00:15:28,330 --> 00:15:36,190
So this plus operator will work as concatenation, so it will concatenate string S2 at the back of String

206
00:15:36,190 --> 00:15:36,610
S3.

207
00:15:36,820 --> 00:15:42,190
So this def will come at backoff string S3.

208
00:15:43,040 --> 00:15:48,340
But what this plus operator will do, so it will add, it will find out the result and it will return

209
00:15:48,340 --> 00:15:48,800
the result.

210
00:15:49,000 --> 00:15:54,590
So the result is going to be stored in S4, so S3 and S2, so there will be no change for it.

211
00:15:54,880 --> 00:15:55,600
So you can see.

212
00:15:56,110 --> 00:15:59,670
So your decision as to which is def correct.

213
00:16:00,400 --> 00:16:05,400
This is your stream is BBK, ABC, so this is DVC and ABC.

214
00:16:05,410 --> 00:16:07,750
So it is correct and this is your string S4.

215
00:16:07,990 --> 00:16:16,090
So testing as well is actually BBC, ABC and then beef will get appended D.F. So this plus operator

216
00:16:16,210 --> 00:16:21,580
can concatenate two strings and there will be no effect on Estragon S2.

217
00:16:21,970 --> 00:16:25,390
So this plus operator will find out the result and it will return the result.

218
00:16:25,630 --> 00:16:28,180
And that result we are storing in a string S4.

219
00:16:29,140 --> 00:16:29,580
Correct.

220
00:16:30,460 --> 00:16:32,170
So that is the power of string.

221
00:16:32,680 --> 00:16:36,730
We can simply with the help of this plus operator, we can just add two strings.

222
00:16:41,770 --> 00:16:46,520
So we can add boosting, we can also add multiple strings, so, for example, you can write to tell.

223
00:16:51,320 --> 00:16:53,240
You can read it like this also, let's see.

224
00:16:57,980 --> 00:16:59,210
So this is your output.

225
00:16:59,240 --> 00:17:03,950
This is your stringers for the ABC, the F Hello Space Cording.

226
00:17:05,560 --> 00:17:07,750
So that is the power of stingless.

227
00:17:08,710 --> 00:17:11,740
Now, you can also write it like this where you can do.

228
00:17:17,930 --> 00:17:18,800
So what you can do?

229
00:17:20,220 --> 00:17:21,750
Initially, us springford.

230
00:17:23,290 --> 00:17:25,329
Usually the swing vote is actually empty.

231
00:17:25,780 --> 00:17:34,810
It is, it is, and it is not containing anything, then you can write it like this is four plus equals

232
00:17:34,810 --> 00:17:35,050
two.

233
00:17:35,350 --> 00:17:37,960
So I can also use this operator plus equals to.

234
00:17:39,250 --> 00:17:39,940
So let's see.

235
00:17:45,010 --> 00:17:46,150
So this is your output.

236
00:17:47,900 --> 00:17:50,590
So you can use plastic cultural operator also.

237
00:17:51,800 --> 00:17:53,660
Now, what is happening in this situation?

238
00:17:55,350 --> 00:17:57,630
What you are doing, you are using plastic to operate.

239
00:17:57,770 --> 00:17:59,050
So what is the meaning of this line?

240
00:17:59,340 --> 00:18:09,000
So as for equals as four plus three plus as two plus, and then you have this very long string hello's,

241
00:18:09,000 --> 00:18:09,690
rescoring.

242
00:18:11,940 --> 00:18:17,730
Now, what is happening so this Hallowes bickering will get upended after and still not a combined result

243
00:18:17,730 --> 00:18:23,880
of his two plus helicopter will get upended at street behind the back off at the back end of history.

244
00:18:24,180 --> 00:18:31,950
And no combined result of three plus as tubeless helicopter will get upended after S4, what is actually

245
00:18:32,160 --> 00:18:32,720
pretty strong.

246
00:18:33,190 --> 00:18:35,220
So this is interesting.

247
00:18:35,250 --> 00:18:37,230
So we also have a function size.

248
00:18:37,740 --> 00:18:39,540
Let us try to print the size.

249
00:18:45,310 --> 00:18:52,140
So let's try to bring this so out, you can call sales function, let's say I want to call the sales

250
00:18:52,150 --> 00:18:53,010
on Asfour.

251
00:18:53,020 --> 00:18:54,430
So as for that, sales.

252
00:18:57,890 --> 00:19:07,010
Or you also have the function as darkland, so as for Nordlund, so Nordlund and Darcis, both the functions

253
00:19:07,010 --> 00:19:07,520
are the same.

254
00:19:07,550 --> 00:19:12,800
They will give you the same output so you can use any function, you can use function or you can use

255
00:19:12,800 --> 00:19:13,550
lenth function.

256
00:19:13,790 --> 00:19:15,140
They are they both are same.

257
00:19:20,640 --> 00:19:28,350
So you can see 21 and 21, so this is 21 different characters, so these are two different characters.

258
00:19:31,980 --> 00:19:34,150
OK, so what other functions do we have?

259
00:19:35,010 --> 00:19:39,200
We have one more function, and the name of that function is substring.

260
00:19:39,870 --> 00:19:45,600
So what they can do as for dot substring.

261
00:19:47,250 --> 00:19:51,960
So this subsetting function will take the index, so let's say I'm giving index three.

262
00:19:53,410 --> 00:19:55,260
So what does substring function will do?

263
00:19:57,800 --> 00:19:59,390
So suppose this is costing.

264
00:20:01,770 --> 00:20:10,620
ABC, ABC, and if you call the function Astarte substate, so Sebastiani means substring and it will

265
00:20:10,620 --> 00:20:11,530
give the index.

266
00:20:11,550 --> 00:20:13,470
So I want to give the index three.

267
00:20:13,830 --> 00:20:14,670
So what will happen?

268
00:20:14,700 --> 00:20:15,570
This is the index zero.

269
00:20:15,570 --> 00:20:16,260
This is index one.

270
00:20:16,260 --> 00:20:17,910
This is indexed to and this is index three.

271
00:20:18,210 --> 00:20:21,560
So starting from industry till the end, it will give me everything.

272
00:20:21,840 --> 00:20:23,370
So it will give me ABC.

273
00:20:23,940 --> 00:20:25,020
This will be the output.

274
00:20:27,050 --> 00:20:30,830
Now, if this is your string later, this is ABCDE.

275
00:20:32,130 --> 00:20:38,830
And if you call the function as a substitute and if you will give index zero.

276
00:20:39,150 --> 00:20:40,980
So starting from index is zero.

277
00:20:42,350 --> 00:20:49,880
The end, it will give you the output, so the output will be ABCDE starting from the index zero in

278
00:20:49,890 --> 00:20:52,960
the last index, it will give you all the characters.

279
00:20:53,420 --> 00:20:55,400
So that is the meaning of substring.

280
00:20:57,110 --> 00:20:59,720
OK, so let's check our substring function.

281
00:21:01,850 --> 00:21:08,090
So I'm calling substring function on S4, so starting from Index three till the last index, it will

282
00:21:08,090 --> 00:21:09,390
give me all the characters.

283
00:21:09,860 --> 00:21:11,390
So let's see what that output.

284
00:21:15,670 --> 00:21:22,220
So the size is 21 now, what is it next to you, so the auto industry starts from E!

285
00:21:22,540 --> 00:21:26,530
So starting from E till the last, it is giving me everything you can see.

286
00:21:26,830 --> 00:21:31,590
It is a starting from ABC, ABCDE and then recording this.

287
00:21:31,600 --> 00:21:34,660
So starting from industry, I have given industry here.

288
00:21:34,870 --> 00:21:39,190
So starting from industry till the last and next it will give me all the characters.

289
00:21:39,610 --> 00:21:41,530
So it is giving me all the characters.

290
00:21:44,080 --> 00:21:47,110
Now, there is one more variation of substring function.

291
00:21:48,720 --> 00:21:55,620
So what is the second variation, so in the second variation, what we will do so in this, I am giving

292
00:21:55,620 --> 00:21:57,570
only one value as input.

293
00:21:57,870 --> 00:22:03,540
Now, in the second variation, you will call the function Sebesta, you will give the starting index

294
00:22:03,540 --> 00:22:06,510
and you will give me how many characters do I need.

295
00:22:06,960 --> 00:22:13,190
So here what I'm doing, start from industry and give me three characters.

296
00:22:13,200 --> 00:22:16,110
So basically it will give you the character presented index three.

297
00:22:16,650 --> 00:22:20,880
It will give you the character personality index four, it will give you the character presented Index

298
00:22:20,880 --> 00:22:25,320
five because the length has to be three.

299
00:22:27,200 --> 00:22:30,620
Now, for example, if you will call the function as dark Sebesta.

300
00:22:32,390 --> 00:22:39,170
So start giving me characters starting from zero and give me two characters, so the output of this

301
00:22:39,170 --> 00:22:43,100
line will be Ebbie because this is zero character.

302
00:22:43,130 --> 00:22:44,050
This is one character.

303
00:22:44,060 --> 00:22:48,020
And so it will give you the character presented zero index.

304
00:22:48,050 --> 00:22:52,850
The character plays in that one index because I have to give only two characters because the length

305
00:22:52,850 --> 00:22:53,230
is too.

306
00:22:53,570 --> 00:22:55,020
So it will be my output.

307
00:22:55,970 --> 00:22:56,900
Now, one more thing.

308
00:22:57,230 --> 00:23:00,190
So this substring function, it will not change my string.

309
00:23:00,440 --> 00:23:02,290
It will just return me the substring.

310
00:23:02,480 --> 00:23:06,700
So basically you can do something like this as two is as Sebesta.

311
00:23:08,720 --> 00:23:09,600
Zero Komada.

312
00:23:09,920 --> 00:23:14,180
So this substring function, it does not change the original listing, in fact, it returns the new

313
00:23:14,180 --> 00:23:14,570
string.

314
00:23:15,410 --> 00:23:16,130
So let's see.

315
00:23:23,090 --> 00:23:31,250
So starting from so starting from the third character, starting from the third index, give me five

316
00:23:31,250 --> 00:23:31,820
characters.

317
00:23:33,950 --> 00:23:35,480
So let's see what we output.

318
00:23:41,060 --> 00:23:42,140
So this was.

319
00:23:44,370 --> 00:23:52,620
So this is the five characters starting from industry, so ABC, the OK, so starting from industry,

320
00:23:52,650 --> 00:23:57,390
give me the five characters so it will give me the character presented the next three, four, five,

321
00:23:57,390 --> 00:23:58,380
six and seven.

322
00:23:59,730 --> 00:24:06,520
Simple and what you can also do so you can store the resulting in the string and you can be interesting.

323
00:24:06,990 --> 00:24:09,570
So let us store the desert and S5.

324
00:24:11,980 --> 00:24:13,720
And you can print as five.

325
00:24:17,180 --> 00:24:21,570
So basically, this substring function, it will not change the original listing symbol.

326
00:24:21,890 --> 00:24:23,210
So let's test.

327
00:24:27,470 --> 00:24:28,940
OK, so this is Annalyn.

328
00:24:35,480 --> 00:24:37,940
So absolutely perfect.

329
00:24:39,940 --> 00:24:46,220
OK, so what other functions do we have so we have one more function find function.

330
00:24:46,330 --> 00:24:49,040
So basically what you can do, you will call the function find.

331
00:24:49,390 --> 00:24:50,500
So as for DOT.

332
00:24:51,480 --> 00:24:55,350
Find and I want to find various ABC president.

333
00:24:56,400 --> 00:24:59,820
I want to find a way it is ABC president and Stringer as food.

334
00:25:01,500 --> 00:25:06,660
So how a find function works, so suppose this is your string.

335
00:25:08,150 --> 00:25:17,780
Let's say this is the if ABC, ABC and then again ABC, and if I call the function as not find.

336
00:25:19,050 --> 00:25:19,590
ABC.

337
00:25:21,940 --> 00:25:27,560
So basically, I want to find various ABC present and this is string, so ABC is present here.

338
00:25:27,580 --> 00:25:28,650
ABC is present here.

339
00:25:28,660 --> 00:25:29,700
ABC is present here.

340
00:25:29,950 --> 00:25:32,340
So this fine function will return an integer.

341
00:25:32,680 --> 00:25:34,570
So this integer is actually the index.

342
00:25:35,260 --> 00:25:38,690
So an index of various this ABC present.

343
00:25:39,040 --> 00:25:41,430
So this ABC is presented multiple locations.

344
00:25:41,430 --> 00:25:42,620
So zero one two.

345
00:25:43,000 --> 00:25:44,120
So this is indexed three.

346
00:25:44,440 --> 00:25:46,210
So ABC is present at index three.

347
00:25:46,820 --> 00:25:49,410
So this is four, five, six, seven, eight.

348
00:25:50,020 --> 00:25:52,580
And then this is nine, 10 and 11.

349
00:25:52,930 --> 00:25:56,390
So this ABC string is presented through index.

350
00:25:56,440 --> 00:25:57,940
It is present at index three.

351
00:25:59,410 --> 00:26:04,120
It is pleasant out index six and it is pleasant at Index nine.

352
00:26:05,570 --> 00:26:12,350
So three times this string ABC is present, this fine function will have done me the first index, the

353
00:26:12,350 --> 00:26:15,260
index at which it will find the ABC first.

354
00:26:15,560 --> 00:26:16,740
So the output will be three.

355
00:26:17,900 --> 00:26:25,470
Now, if the string is let's say this is ABC, then ABC, then AC and then ABC.

356
00:26:25,910 --> 00:26:29,030
So if this is the string and I call the function as Dart Find.

357
00:26:30,730 --> 00:26:32,800
String ABC, so what will be my output?

358
00:26:32,830 --> 00:26:36,400
So where does ABC so is present here only so.

359
00:26:37,490 --> 00:26:42,920
The index zero one, two, three, four, five and six, so it will return me six.

360
00:26:44,580 --> 00:26:49,560
Correct, and if there are multiple locations at which the string is present, it will give me.

361
00:26:50,540 --> 00:26:52,010
The index of the first location.

362
00:26:54,110 --> 00:26:55,910
So I'm calling the find function.

363
00:26:55,940 --> 00:27:01,130
I want to find out which is ABC present interesting as food, so it will return me an integer.

364
00:27:05,190 --> 00:27:09,970
So ABC is presenting the next three, so let's see.

365
00:27:09,990 --> 00:27:13,740
So this is the string S4, you can see ABC.

366
00:27:13,950 --> 00:27:18,870
So ABC is present at the next three, so that's why the output is indexed.

367
00:27:18,870 --> 00:27:19,140
Three.

368
00:27:19,860 --> 00:27:20,430
Perfect.

369
00:27:21,490 --> 00:27:23,440
So what other functions do we have?

370
00:27:25,000 --> 00:27:31,250
We have a function to string, so, for example, you have an integer, let's say it is 123.

371
00:27:31,870 --> 00:27:35,480
Now you want to convert this integer into a string.

372
00:27:36,310 --> 00:27:37,130
So what you can do.

373
00:27:37,840 --> 00:27:39,430
So let us create a new string.

374
00:27:39,430 --> 00:27:40,390
String a six.

375
00:27:41,750 --> 00:27:44,030
So we have a function to underscore string.

376
00:27:47,740 --> 00:27:54,280
And we will give you guys input, so it will return me the string, it will convert integer into string

377
00:27:54,550 --> 00:27:57,070
and let us sprint as six.

378
00:28:04,730 --> 00:28:15,980
So this six, this is six, so 123 is now string 123, so I'm repeating myself, so this is 123 integer,

379
00:28:16,280 --> 00:28:17,610
this is 123 integer.

380
00:28:17,960 --> 00:28:19,250
Now you are playing function.

381
00:28:19,250 --> 00:28:22,870
Boosting and boosting function will take integers input.

382
00:28:23,270 --> 00:28:28,200
So this boosting function, it will take integers input.

383
00:28:28,220 --> 00:28:31,050
I am giving 123 and it will convert the integer.

384
00:28:31,050 --> 00:28:31,710
Interesting.

385
00:28:31,730 --> 00:28:33,800
So this is now string 123.

386
00:28:34,990 --> 00:28:41,410
Fine, so desisting one, two, three, you can change the values also because we can we can we can

387
00:28:41,410 --> 00:28:43,520
treat the strings as if it is NATO.

388
00:28:44,020 --> 00:28:46,270
So let us change the characters.

389
00:28:51,280 --> 00:28:53,380
So, for example, I want to change.

390
00:28:55,310 --> 00:29:01,880
The first index, the of the first index, let's say it is for now, because it is a string, so you

391
00:29:01,880 --> 00:29:04,190
have to give credit for not integer for.

392
00:29:05,400 --> 00:29:09,060
So this is characterful now and now, let us also bring Essex again.

393
00:29:18,390 --> 00:29:20,740
So 123 was my original listing.

394
00:29:20,760 --> 00:29:26,400
Now I change to in dofor, so the is now converted into four.

395
00:29:28,770 --> 00:29:37,320
So we have a function to similarly we also have a function you do okay, so so I'm using it again.

396
00:29:37,470 --> 00:29:38,550
So this is a.

397
00:29:41,480 --> 00:29:47,570
So this is actually we have a function, you do okay, now this is the wavefunction, it will take a

398
00:29:47,570 --> 00:29:49,880
string as input and it will return within a year.

399
00:29:50,720 --> 00:29:52,940
So now let us spend a.

400
00:30:00,530 --> 00:30:03,980
OK, so I don't know in which library to wavefunction this present.

401
00:30:04,730 --> 00:30:05,900
So what I'm going to do.

402
00:30:07,290 --> 00:30:08,580
So instead of these three.

403
00:30:24,050 --> 00:30:26,390
OK, this is wavefunction is not working.

404
00:30:43,060 --> 00:30:48,220
OK, so for walking of this IT wavefunction, I think you have to write something like this, a six.

405
00:30:49,210 --> 00:30:51,970
Nazi and let's go to St..

406
00:30:59,230 --> 00:31:00,620
OK, so now it is working.

407
00:31:01,750 --> 00:31:09,370
So this is wavefunction, what it does is it converts the given strength into an integer so that it

408
00:31:09,370 --> 00:31:12,100
wavefunction it will take integers.

409
00:31:12,100 --> 00:31:14,650
And so I am giving it will take a string as input.

410
00:31:14,680 --> 00:31:17,610
So I'm giving a six, so I'm giving one four.

411
00:31:17,740 --> 00:31:22,510
So I'm giving 143 and it will return me integer 143.

412
00:31:24,060 --> 00:31:24,480
OK.

413
00:31:27,440 --> 00:31:29,810
Now, let's say if you want to insert elements.

414
00:31:31,910 --> 00:31:38,450
So you want to insert element in ethics in a string so you can use push back function just like in vector,

415
00:31:38,460 --> 00:31:41,720
so I want to push back, let's say I want to push back five.

416
00:31:42,540 --> 00:31:44,450
So five will get pushed.

417
00:31:45,750 --> 00:31:47,270
So let's run our program again.

418
00:31:53,190 --> 00:31:55,320
So one, four, three, five.

419
00:31:55,730 --> 00:31:59,160
OK, so let us also print Essex, then we will print a.

420
00:32:01,090 --> 00:32:05,380
So after pushing five letters, now opened a six.

421
00:32:17,960 --> 00:32:19,100
So what is happening here?

422
00:32:19,130 --> 00:32:26,000
So this was your 123 then to function will convert 123 integer to 123.

423
00:32:27,690 --> 00:32:33,750
Strength, then you are changing the first character to force, so this will become 140, then you are

424
00:32:33,750 --> 00:32:38,100
pushing five, so this will become one, four, three and five.

425
00:32:38,820 --> 00:32:40,020
You are printing a six.

426
00:32:40,020 --> 00:32:42,720
So one four, three, five is getting printed here.

427
00:32:43,020 --> 00:32:45,030
Then you are using it to wavefunction.

428
00:32:45,030 --> 00:32:47,990
So it wavefunction will convert it into integer.

429
00:32:48,000 --> 00:32:50,160
So this is one, four, three, five and then you are printing.

430
00:32:50,610 --> 00:32:53,040
So it is getting printed one four three five.

431
00:32:54,060 --> 00:32:55,740
So that is how everything is working.

432
00:32:56,490 --> 00:33:00,540
So we have also pushed back function just like in vector.

433
00:33:01,050 --> 00:33:04,460
So you can see strings are much, much powerful then the character.

434
00:33:05,310 --> 00:33:06,960
Now how the strings are working.

435
00:33:06,960 --> 00:33:07,450
So string.

436
00:33:07,470 --> 00:33:08,550
I told you so.

437
00:33:08,550 --> 00:33:13,050
String is actually a class so string is actually a class.

438
00:33:13,050 --> 00:33:18,540
And in the implementation of this class, basically it is using connectivity.

439
00:33:19,380 --> 00:33:23,670
If you will see the implementation of the string class internally, it is using area only.

440
00:33:25,790 --> 00:33:30,320
So I think I have covered many functions of a string.

441
00:33:31,990 --> 00:33:37,450
So if you have any doubt in any of these functions, you can ask me, I will share the call with you,

442
00:33:37,750 --> 00:33:39,100
so I will see you in the next one.

443
00:33:39,430 --> 00:33:39,870
Bye bye.

