1
00:00:00,690 --> 00:00:04,050
Let me show you how I'm going to solve this particular challenge.

2
00:00:04,050 --> 00:00:05,190
So let me comment out.

3
00:00:05,190 --> 00:00:06,090
This one's.

4
00:00:08,200 --> 00:00:08,760
Yes.

5
00:00:08,770 --> 00:00:09,670
Now I'm back.

6
00:00:09,790 --> 00:00:16,990
So the whole logic of this function is to check if a certain strain contains some whitespace.

7
00:00:17,110 --> 00:00:18,940
So here we go.

8
00:00:19,660 --> 00:00:25,870
I'm going to use function statement to create this function, so I'll make it as function here.

9
00:00:27,080 --> 00:00:32,810
Function and now the name of my function as contained.

10
00:00:33,920 --> 00:00:36,230
Contains whitespace.

11
00:00:37,540 --> 00:00:45,520
Now my parentheses and my carry the function should take in a string, so I'll pass in here a string

12
00:00:45,520 --> 00:00:46,350
I want to check.

13
00:00:46,360 --> 00:00:52,330
The next point is that the function should return true if the string contains whitespace and force.

14
00:00:52,330 --> 00:00:53,440
If it does not.

15
00:00:53,650 --> 00:00:58,420
So I'll bring in my return keyword here.

16
00:00:58,420 --> 00:01:08,500
And on the string we have a method called index of remember guys we use index or to determine at which

17
00:01:08,500 --> 00:01:12,310
point does a certain character exist.

18
00:01:12,310 --> 00:01:18,190
So here we can say, I want to check for C in the string we are going to pass into this function.

19
00:01:18,430 --> 00:01:21,700
But this time around I'm going to check for empty string.

20
00:01:22,240 --> 00:01:31,600
So if it exists, meaning that if the result of this one is not equal to negative one, meaning it exists.

21
00:01:31,690 --> 00:01:34,390
Therefore this function is going to return.

22
00:01:34,390 --> 00:01:34,960
True.

23
00:01:34,960 --> 00:01:35,860
So let's see.

24
00:01:36,130 --> 00:01:39,130
Let's call the function assigned to variable.

25
00:01:40,030 --> 00:01:43,870
Variable core result is equal to contains whitespace.

26
00:01:43,870 --> 00:01:46,720
So let it pass in, let's say John.

27
00:01:48,750 --> 00:01:53,490
This function will tend true of us because John doesn't have some whitespace.

28
00:01:53,610 --> 00:01:53,910
Right?

29
00:01:53,910 --> 00:01:55,860
So let's see if I save it.

30
00:01:55,890 --> 00:01:59,310
It's false because this one has new whitespace.

31
00:01:59,520 --> 00:02:01,740
If I bring some whitespace here, let's see.

32
00:02:01,770 --> 00:02:03,000
Now I have.

33
00:02:03,000 --> 00:02:03,540
True.

34
00:02:04,170 --> 00:02:05,340
That is it, guys.

