Welcome.
Now it's time for a little challenge, you will create a program that masks the spam links in a text.
It will be a very efficient, bith manipulation program.
The primary goal of this program is mastering how to manipulate the bytes in a string.
Let's say you have a text document like this one, as you can see, it contains a paneling inside.
Your goal is masking the link automatically.
For example, let me pass this document to my program like this.
OK, let me run this.
As you can see, it masks the link with the stars.
By the way, I use a best substitution.
It just gets the content inside the file.
Then it feeds the content to my program as an argument, depending on your operating system.
This may work or may not work.
If it doesn't work, don't worry.
You can also run the program by passing the argument directly like this.
So it should print something like this here, use double quotes if you don't use them.
Each word may look like a different argument to our program to keep the program simple, you don't need
to check for the upper case or lower case letters, for example.
This doesn't catch the link, but it's OK for now.
You should only catch the HTP link part, OK?
And you should mask it until you see a whitespace character such as a new line tap or a space character.
And so, for example, it only masks the link, but it doesn't mask the rest of the characters after
the whitespace.
Here's a little animation that I prepared for you.
For example, let's say you have called the program with this input data.
Then you may create a new Bisley's as a buffer.
Not that the length of the buffer is equal to the user input.
It's because in the end you'll produce a string with the same length and you'll only mask some characters
in your algorithm, will process the input text, and then it will copy the bytes to the buffer by masking
some of the bytes that belong to the links like so.
Of course, there are some rules.
The first rule is that you shouldn't use a standard library function, you should only solve the challenge
by manipulating the bytes directly.
For example, you should use string indexing, slicing and upending mechanisms to solve the challenge.
That's because the goal of this challenge is to learn as much about manipulating bytes and strings as
you can.
If you use a helper function from the standard library, then it will diminish the goal of this challenge
and you won't learn how to manipulate bytes like a bith Jedi and they be efficient.
I mean, do not concatenate strings to produce a new string.
Instead use a buffer.
You can find more explanations about this challenge in the next article.
All right.
Good luck by.