1
00:00:00,700 --> 00:00:08,860
Let's talk about start with, which is one of the methods that we can use to operate on strengths.

2
00:00:09,100 --> 00:00:16,090
So as usual, at the end of this video, I'm going to have a coding challenge and start with.

3
00:00:16,090 --> 00:00:17,620
So let's get started.

4
00:00:17,830 --> 00:00:25,000
Let me clean up something here and now let me come down here and have a nice comment and call it out.

5
00:00:25,030 --> 00:00:25,690
Start.

6
00:00:26,530 --> 00:00:27,190
Wait.

7
00:00:27,700 --> 00:00:34,540
So the name is even descriptive once they start with, it's a method which is useful for determining

8
00:00:34,540 --> 00:00:38,110
whether a string begins with a specified string.

9
00:00:38,200 --> 00:00:44,480
Well, this is really important because it can help to ensure that a string is in the correct format.

10
00:00:44,500 --> 00:00:51,850
For example, if you're expecting a string to be in all caps and then you can use to check if the string

11
00:00:51,850 --> 00:00:53,220
start with a capability.

12
00:00:53,230 --> 00:00:53,830
Right.

13
00:00:53,950 --> 00:00:58,870
So let's see with some code to better understand what I'm referring to.

14
00:00:59,110 --> 00:01:01,600
So let me have a comment.

15
00:01:04,760 --> 00:01:09,500
So let me declare my invariable core strength, which is equal to.

16
00:01:10,510 --> 00:01:11,200
Welcome.

17
00:01:11,230 --> 00:01:13,300
I think this video has been declared.

18
00:01:13,300 --> 00:01:15,580
So let me comment out all these types.

19
00:01:15,580 --> 00:01:16,030
Yes.

20
00:01:16,030 --> 00:01:19,560
So that let me comment the one that we have finished.

21
00:01:20,080 --> 00:01:20,740
It's good.

22
00:01:20,740 --> 00:01:31,450
So now I have declared my invariable core welcome that this work begins with W or Z or M or uppercase.

23
00:01:31,450 --> 00:01:32,860
Well, let's see.

24
00:01:33,250 --> 00:01:39,550
So let's assign the results to a variable core result.

25
00:01:39,550 --> 00:01:44,290
And then on the SDR, I will have what is called start with.

26
00:01:45,730 --> 00:01:49,700
Start with what's let's say start with W now.

27
00:01:49,720 --> 00:01:50,560
Here you go.

28
00:01:50,740 --> 00:01:54,670
So when I console that log, the result.

29
00:01:54,700 --> 00:01:55,540
Let's see.

30
00:01:57,150 --> 00:02:06,720
Check the console and now indeed they start with W but the cool part here is that this is case sensitive,

31
00:02:06,720 --> 00:02:12,840
meaning that if here is uppercase and here you provide lowercase is going to return false.

32
00:02:12,840 --> 00:02:17,460
So here if I provide lowercase, we see that it has returned force.

33
00:02:17,700 --> 00:02:22,770
Well, I use this method a lot when dealing with a full stack application.

34
00:02:22,770 --> 00:02:29,820
For example, when I'm trying to implement authentication inside my back end, I use this method to

35
00:02:29,820 --> 00:02:34,170
check whether the header contains some token.

36
00:02:34,170 --> 00:02:38,400
So start with it's a crucial method or important method to be familiar with.

37
00:02:38,400 --> 00:02:41,280
And there are some little use cases where we can use this method.

38
00:02:41,280 --> 00:02:48,060
One is to check whether, for example, if X pattern or string should be caps and the person provides

39
00:02:48,060 --> 00:02:54,000
lowercase, if a string start with uppercase, then it means that I don't want to be uppercase as well.

40
00:02:54,300 --> 00:02:56,130
This is pretty simple method.

41
00:02:56,130 --> 00:03:01,980
So in the next video, let's see how we can practice this with some coding challenge.

