WEBVTT

00:01.200 --> 00:02.080
Hello, everyone.

00:02.430 --> 00:08.750
In this particular session, we will be discussing about strains we would discuss about various dring

00:08.760 --> 00:16.510
operations like strip split, replace, case change, string formatting and slicing.

00:16.950 --> 00:18.210
So let's begin with it.

00:23.950 --> 00:26.290
Let's start with transcreation post.

00:30.980 --> 00:38.210
A string is a sequence of characters, so a string can have a single character, say, E..

00:39.860 --> 00:44.870
A string can also have a sequence of characters or just a word.

00:49.540 --> 00:51.100
See what?

00:52.980 --> 00:58.560
A stream can be created by a single code, double or triple code.

00:59.250 --> 01:04.210
So let's see how we can create a string by we have just seen how to create a single code.

01:04.230 --> 01:07.280
So we'll see how to create string using double code.

01:07.560 --> 01:09.780
So I'm creating a sentence.

01:13.730 --> 01:20.810
So this is using double quotes and you can see the string has been created with the same format, but

01:20.810 --> 01:22.280
only the syntax is different.

01:22.310 --> 01:25.000
We have used a similar code here and here.

01:25.040 --> 01:26.160
We have used a double.

01:28.080 --> 01:31.560
Another way of creating a string is using triple quotes.

01:32.550 --> 01:36.720
So here I am using triple code, so I'm saying this is.

01:40.270 --> 01:43.330
Month two lines train.

01:45.360 --> 01:46.110
This.

01:49.340 --> 01:52.160
Go on and.

01:55.710 --> 02:00.000
And let me save this particular string in say that.

02:02.590 --> 02:03.880
So if your friend said.

02:14.910 --> 02:19.360
Now you can see that the multiline string is coming as a multiline comment.

02:19.800 --> 02:24.250
Now, let's say we have a particular word which has gotten it.

02:24.600 --> 02:26.340
So this is a.

02:29.880 --> 02:31.200
Ordinary.

02:34.220 --> 02:36.770
But not so.

02:39.680 --> 02:40.670
Ordinary.

02:42.240 --> 02:50.130
Multiline strength now you can see here I have begun my strength using a triple code, so this understands

02:50.130 --> 02:56.160
that this double code, which has been used inside the same Din's and the single code which has been

02:56.160 --> 03:03.540
used inside the sentence, is a part of the sentence and is not defining on the string inside this.

03:03.900 --> 03:06.810
So it will consider this as a single string.

03:07.560 --> 03:17.010
And this is we get as a response so we can use Dubofsky string, triple string or single code for the

03:17.010 --> 03:22.590
string creation's so that we can distinguish between the codes which are being used in Dohnanyi.

03:22.800 --> 03:29.490
So let's see if I have a single code which is being used inside the string, then I can use either a

03:29.490 --> 03:36.480
multiline string or a double code to start my string so that this particular code would be considered

03:36.480 --> 03:37.800
as a part of the string.

03:38.490 --> 03:40.260
Same applies for double code.

03:40.260 --> 03:47.070
So in case I have a double code in my string, I can use a single code for starting and ending my string

03:47.070 --> 03:49.320
so that the machine would understand.

03:49.540 --> 03:51.630
Then this is a part of a sentence.

03:55.450 --> 04:01.570
The next thing which we can do is we can concatenate multiple strings.

04:03.140 --> 04:08.210
So let's say I create a string named X, which is.

04:10.230 --> 04:10.920
Hello.

04:13.360 --> 04:16.750
My name is Monty.

04:19.070 --> 04:21.680
And why, as.

04:25.610 --> 04:27.850
What is your name?

04:29.330 --> 04:36.410
Now, what I can do is with this particular string, I can combine these strings, so let's run this

04:36.410 --> 04:44.870
particular piece of code and I can concatenate these by using said is equal to X plus Y.

04:45.380 --> 04:48.410
So this would concatenate this and those forms would be.

04:51.070 --> 04:53.090
Hello, my name is Monty, and what is your name?

04:53.110 --> 04:55.000
So these have been concatenated together.

04:56.030 --> 05:02.030
I can also do this in opening statement so I can say something like Brent.

05:05.380 --> 05:07.270
X plus.

05:10.590 --> 05:13.770
Code space, hello.

05:16.060 --> 05:17.580
In brackets, let's say.

05:21.060 --> 05:23.190
And I can also.

05:24.380 --> 05:26.530
Add another string here, say.

05:27.830 --> 05:34.010
So when I do this, it will contain whatever I give in and say this now this is possible because these

05:34.010 --> 05:35.890
are all strings now.

05:35.900 --> 05:37.970
Same thing I can do with numbers.

05:39.300 --> 05:42.510
So let's say I do this with.

05:45.340 --> 05:53.200
Numbers being two plus nine, so this will give me 11 as a result, because now it would understand

05:53.200 --> 05:57.600
that I have given in numbers and I'm using a plus operator.

05:57.760 --> 06:01.160
So this means that I don't want to concatenate these together.

06:01.420 --> 06:03.700
I want to add these numbers.

06:03.850 --> 06:08.500
But in case I want to concatenate these together, what I can do is.

06:09.810 --> 06:16.380
I can simply put these in quotes, and now it would seem that this is a string.

06:17.360 --> 06:19.890
And it would concatenated these together.

06:20.360 --> 06:27.790
But in case you want to try something like let's say you want to try something with a string on a number,

06:28.280 --> 06:31.060
in that case, let's see what would happen.

06:32.090 --> 06:38.240
Now, look, we've got a string to and I'm giving mine as a number, so when I ran this particular piece

06:38.240 --> 06:45.130
of code, I get the error, saying it can only concatenate string, not integer to a string.

06:45.380 --> 06:49.040
So we will not be able to concatenate string with a number.

06:49.260 --> 06:54.570
You can only concatenate string with a string or we can add two numbers here.

06:54.800 --> 06:57.730
So this is what we can do in case of string.

06:57.740 --> 07:03.020
So this is one thing which you need to always remember that in case you want to concatenate two numbers,

07:03.020 --> 07:09.470
you will have to convert them industry and then concatenate in case you want to add two numbers, you

07:09.470 --> 07:15.500
can directly use them and in case you want to concatenate two strings, then that would be possible

07:15.740 --> 07:20.470
by using plus operator, which would act as a concatenated here.

07:23.750 --> 07:43.310
Let's create a string Z, as this is a very I long I string, I like this string now I have created

07:43.310 --> 07:48.730
the string and I want to split the string on I.

07:48.770 --> 07:50.270
So what I can do is.

07:51.350 --> 08:03.320
I can write something like Z dot split, and inside this I can give the character or special character

08:03.320 --> 08:04.580
on which I want to split.

08:04.580 --> 08:05.600
So I'm giving a.

08:06.840 --> 08:14.790
So this gives me the split with I now, in case I don't want to split down, I want to split on the

08:14.790 --> 08:19.550
space, I can give a space here and it would split on space.

08:19.770 --> 08:26.550
If you don't give anything, it will simply don't split because we have not given anything.

08:26.580 --> 08:31.020
So if you just don't give anything, it will split on space by default.

08:32.180 --> 08:34.740
So these are the different combinations we can try.

08:36.080 --> 08:42.560
Now, another thing is using strength, so let's use drip.

08:43.070 --> 08:50.420
So for using strep, what we can do is let's create another string Z and have a lot of spaces in the

08:50.420 --> 08:50.870
beginning.

08:51.800 --> 08:53.910
Now we have a lot of spaces in the beginning.

08:53.930 --> 08:56.180
Let's see something.

08:58.640 --> 08:59.990
Something.

09:02.400 --> 09:11.520
And a lot of spaces, so this is my Z and I want to strip this, so what I can do is I can do something

09:11.520 --> 09:16.800
like Z is equal to Z dot strip.

09:17.700 --> 09:25.770
And when I don't give anything, it will strip off all the white spaces from the right side and the

09:25.770 --> 09:26.970
right left side.

09:27.270 --> 09:30.030
So what I can do is I can simply print.

09:32.520 --> 09:40.020
Zent quickly, so once I do this, it have it has stripped of all the spaces from the beginning and

09:40.020 --> 09:45.900
the end of the thing, what I can do is I can do a strip.

09:47.320 --> 09:51.310
From the left side or the right side, so here I am stripping from the left side.

09:52.220 --> 09:55.750
So it gives me this, but I won't be able to see the spaces here.

09:56.810 --> 10:00.590
Because if you can see, I have highlighted the spaces here.

10:05.930 --> 10:14.000
Another function which we have is replace, so how we can use replaces, we can simply seize it.

10:14.920 --> 10:16.870
Dodd plays.

10:21.290 --> 10:26.220
And in the replace function, we will give the character or the string that we want to replace.

10:26.240 --> 10:28.910
So let's say we want to replace some.

10:30.300 --> 10:30.870
With.

10:32.060 --> 10:33.020
Nothing.

10:39.090 --> 10:39.810
And.

10:42.140 --> 10:48.210
This would give us nothing instead of something, the next thing.

10:48.230 --> 10:52.740
Now, this could be done in a long string, also in a smaller string.

10:52.770 --> 10:55.530
Also, you can replace a larger string.

10:55.560 --> 10:58.350
Also, you can replace just one character also.

10:58.370 --> 10:59.900
So it is completely up to you.

11:00.140 --> 11:06.030
And you can see it has replaced all the occurrences of this particular string in Z.

11:06.590 --> 11:09.530
The next thing which we can do is we can change the keys.

11:10.040 --> 11:14.720
So to change the keys, what we can do is begin.

11:14.960 --> 11:21.500
First of all, I can introduce one more thing to you, which is then function Leane function with just

11:21.500 --> 11:28.520
give the length of said so Lent is 19 characters so you can come visit Zettl.

11:28.520 --> 11:37.100
One, two, three, four, five, six, six devices 12.

11:38.770 --> 11:44.350
So we are discussing mode something something that this will have one, two, three, four, five,

11:44.350 --> 11:49.150
six, seven, eight, nine, and that would be 18 plus one.

11:49.150 --> 11:50.740
Space's 19.

11:52.040 --> 12:00.750
So let's learn about the case, so for keeps changing, what we can do is we can say something like

12:00.780 --> 12:03.470
said Dot Apple.

12:04.560 --> 12:10.090
So it will change the case of Z to Apple, we can see something.

12:10.740 --> 12:15.930
Now, let's assign this to Z also and then protect.

12:19.560 --> 12:22.320
So now the case of Z has been changed to uppercase.

12:22.350 --> 12:30.780
Now, if I want to convert this into a lower case, I can see Z dot lower and it will convert it to

12:30.780 --> 12:31.650
lowercase.

12:32.100 --> 12:35.010
I can also see Z.

12:37.340 --> 12:38.060
Dot.

12:40.590 --> 12:50.730
Capitalize, Z, dot capitalize and Z dot capoulas would capitalize the first character in the string.

12:52.310 --> 12:59.010
Next week, a new string formatting, how do you string formatting is we already have so let's see the

12:59.010 --> 13:02.150
world values of X Y.

13:03.110 --> 13:06.580
So what we can do is let's I want to print.

13:13.050 --> 13:17.690
Hello, my name is Monty, and I can add something more to it.

13:19.090 --> 13:21.310
So what I can do is.

13:22.990 --> 13:31.240
I can either concatenate these and use these as a single string on the thing, what I can do is I can

13:31.240 --> 13:36.030
create placeholders in my strings or that what I will have to do is I will say print.

13:37.000 --> 13:43.450
And inside prison, I can see something like this is.

13:49.160 --> 13:51.230
Oh, sentence.

13:58.460 --> 14:00.200
My name is.

14:02.400 --> 14:03.540
The blank space.

14:06.610 --> 14:07.300
Hello.

14:09.410 --> 14:10.160
Blacks face.

14:11.160 --> 14:13.120
Now, this is the Indicus train.

14:13.590 --> 14:17.010
Apart from that, I can include a dot for MACD.

14:18.190 --> 14:25.860
Which will take off your argument and the argument would be whatever I want to fill in these holy places.

14:26.260 --> 14:30.940
So if I want to fill in, let's say this is this, then I want to add my.

14:32.080 --> 14:34.720
The next thing which I want to add is.

14:36.470 --> 14:41.240
Munsie And the next thing which I want to add is Montay again.

14:43.100 --> 14:49.910
So once I've done this, you see the blanks which I have introduced by these holy places, have been

14:49.910 --> 14:53.910
filled by the values which I have provided in the for Mike.

14:54.170 --> 14:56.090
I can provide numbers also.

14:56.090 --> 14:58.100
I can provide strings also.

14:58.100 --> 14:59.830
I can provide variables also.

14:59.870 --> 15:01.990
That is completely up to my wish.

15:02.450 --> 15:10.190
Another thing, what I can do is instead of using these holy places and of without any police numbers,

15:10.190 --> 15:12.770
what I can do is I can remove this.

15:13.340 --> 15:17.600
So because manses repeating so I don't really want to write it again and again.

15:17.960 --> 15:20.990
So instead of having this, I can say zero.

15:22.980 --> 15:23.520
One.

15:25.140 --> 15:27.780
And one, so this would.

15:29.900 --> 15:36.650
Simply take the values from the indexes, so the zeroth index is mine, so it considers zero here and

15:36.650 --> 15:41.310
the first index is Monte, so it puts Monte in both of these places.

15:41.870 --> 15:48.050
Now, in case I want to switch the places, I can also do something like this.

15:50.310 --> 15:58.780
I will put this here, and instead of zero, I can please one and instead of one, I can play several.

15:59.340 --> 16:03.100
So the index says is what is important to you.

16:03.360 --> 16:07.260
So now, because I have given my team the zero the index, I am putting zero here.

16:07.830 --> 16:09.600
So this is about string formatting.

16:09.910 --> 16:15.300
We will learn about string slicing in the next section.
