WEBVTT 00:03.690 --> 00:04.240 Welcome. 00:04.620 --> 00:10.770 Now it's time for a little challenge, you will create a program that masks the spam links in a text. 00:10.890 --> 00:13.920 It will be a very efficient, bith manipulation program. 00:14.340 --> 00:19.350 The primary goal of this program is mastering how to manipulate the bytes in a string. 00:21.820 --> 00:27.790 Let's say you have a text document like this one, as you can see, it contains a paneling inside. 00:28.000 --> 00:30.550 Your goal is masking the link automatically. 00:31.210 --> 00:34.720 For example, let me pass this document to my program like this. 00:37.280 --> 00:38.510 OK, let me run this. 00:39.900 --> 00:43.130 As you can see, it masks the link with the stars. 00:43.800 --> 00:46.280 By the way, I use a best substitution. 00:46.740 --> 00:49.340 It just gets the content inside the file. 00:49.380 --> 00:54.370 Then it feeds the content to my program as an argument, depending on your operating system. 00:54.390 --> 00:56.430 This may work or may not work. 00:56.430 --> 00:58.220 If it doesn't work, don't worry. 00:58.230 --> 01:01.890 You can also run the program by passing the argument directly like this. 01:03.930 --> 01:09.540 So it should print something like this here, use double quotes if you don't use them. 01:09.570 --> 01:14.700 Each word may look like a different argument to our program to keep the program simple, you don't need 01:14.700 --> 01:18.650 to check for the upper case or lower case letters, for example. 01:18.660 --> 01:21.390 This doesn't catch the link, but it's OK for now. 01:21.720 --> 01:24.480 You should only catch the HTP link part, OK? 01:25.510 --> 01:32.050 And you should mask it until you see a whitespace character such as a new line tap or a space character. 01:32.080 --> 01:38.230 And so, for example, it only masks the link, but it doesn't mask the rest of the characters after 01:38.230 --> 01:39.040 the whitespace. 01:39.820 --> 01:42.340 Here's a little animation that I prepared for you. 01:42.820 --> 01:46.800 For example, let's say you have called the program with this input data. 01:47.440 --> 01:50.170 Then you may create a new Bisley's as a buffer. 01:51.710 --> 01:55.610 Not that the length of the buffer is equal to the user input. 01:56.090 --> 02:03.020 It's because in the end you'll produce a string with the same length and you'll only mask some characters 02:03.020 --> 02:10.280 in your algorithm, will process the input text, and then it will copy the bytes to the buffer by masking 02:10.280 --> 02:13.490 some of the bytes that belong to the links like so. 02:15.690 --> 02:17.590 Of course, there are some rules. 02:18.120 --> 02:24.660 The first rule is that you shouldn't use a standard library function, you should only solve the challenge 02:24.660 --> 02:26.720 by manipulating the bytes directly. 02:27.180 --> 02:33.420 For example, you should use string indexing, slicing and upending mechanisms to solve the challenge. 02:33.960 --> 02:39.480 That's because the goal of this challenge is to learn as much about manipulating bytes and strings as 02:39.480 --> 02:39.870 you can. 02:40.110 --> 02:46.170 If you use a helper function from the standard library, then it will diminish the goal of this challenge 02:46.170 --> 02:52.230 and you won't learn how to manipulate bytes like a bith Jedi and they be efficient. 02:52.290 --> 02:55.730 I mean, do not concatenate strings to produce a new string. 02:56.130 --> 02:57.450 Instead use a buffer. 02:58.120 --> 03:01.800 You can find more explanations about this challenge in the next article. 03:02.160 --> 03:02.700 All right. 03:02.850 --> 03:03.780 Good luck by.