‫All right.
‫So let's get started.
‫The first thing we have here, of course, is the main method.
‫And within the main method, we already have a console of right line statement.
‫But what we are going to need is a string.
‫And I'm just going to call the string my name and then I'm going to write something like, please enter
‫your name and press enter.
‫All right.
‫So we're not going to need this helloworld write statement and then I need to get the user input.
‫And how do we get the user input?
‫Well, we need to use red line for it.
‫So console dot red line.
‫This will allow us to get the user input and then store it in a variable.
‫And this is what the red line gives us as an output.
‫So the red line method, as you can see, once you hover over it, is going to return a string and that
‫string will be then stored in our my name variable, which is a string as well.
‫And then we can go ahead and convert that into an uppercase string very easily by using the following
‫line of code.
‫So you can see here, string my name, uppercase is going to be string format uppercase and then the
‫my name to upper.
‫So this method here called to upper as a string method.
‫So a method that we can apply to a string and it allows us then to basically make the whole statement
‫and uppercase statement.
‫All right.
‫So let's just test that real quick.
‫By displaying this my name uppercase in the console.
‫All right, so let's run it.
‫So there you are.
‫It says, please enter your name and press enter.
‫So I'm just going to say Dennis or let's do it correctly.
‫Then it's Panopto, that's my name.
‫And you can see uppercase Dennis pun user.
‫So the whole word for the whole string was made in uppercase string.
‫Okay.
‫All right.
‫So that was the first part now doing the same thing for lowercase and then also trimming and finally
‫just printing the substring.
‫Okay, let's do that real quick.
‫So here we have the three.
‫Examples.
‫So first of all, my name lowercase this will also use the format method and there we enter the text
‫or past the text lowercase.
‫And then here we use this curly brackets, zero curly brackets, which will then allow us to simply
‫display whatever comes after this comma here.
‫So in our case, it's going to be my name to lower.
‫So we take my name.
‫So whatever the user has entered in this line and then we will see that it will be a lowercase string.
‫So my name lowercase will be a lowercase string.
‫Then let's look at my name trimmed.
‫So let's say we enter something like empty space.
‫Dennis Empty space to empty space.
‫Then it would trim the empty spaces at the beginning and at the end.
‫And that's what this trim does.
‫So this trim method, my name Dot Trim and then my name substring.
‫That will give us the.
‫Here we're calling this method here called substring.
‫And what it will do is it will start at zero and we'll have a length of five.
‫So this will return the length of the string of five and start at the position zero.
‫So let's just test it.
‫Let's just try it and see what kind of result we will get.
‫And I'm going to add all of those missing lines here.
‫So what we can see here is that we're just writing all of those variables that we just created onto
‫the console.
‫So let's run it again.
‫So I'm going to enter empty space.
‫Dennis Pan, Utah.
‫Empty space.
‫You can see here, I changed it to Dennis Pan, Utah then.
‫And by the way, there is an empty space here.
‫When you click on it, you can see it, otherwise you cannot see it.
‫So that's really difficult here.
‫But you can see there are empty spaces afterwards as well.
‫But here for this case, I can see this this very first one is not an empty space.
‫This is just the empty space that we created here, this one.
‫But then the other one, that's the one that is interesting.
‫And it's this one that I entered.
‫So I also entered empty spaces.
‫And you can see here trim value.
‫There is no empty space that is inside of that string.
‫So the empty space before that was cut out, it was trimmed off the string and you can see the substring
‫value is Danny.
‫And why is it Danny and not Dennis?
‫Well, because the string that I entered was underscore Dennis.
‫And what we did with the substring here was.
‫We started at zero, which means we had the underscore and then we had a length of five.
‫So let's just have a look at this in this particular example here.
‫So we started with an underscore and then Dennis Pan to underscore.
‫So it starts at zero and it's a length of five.
‫So let's look at five characters and you can see it's those five characters.
‫So it's underscore the E and I.
‫That's it.
‫All right.
‫So that's it for this exercise.
‫I hope you tried and followed along and you finish this exercise yourself.
‫All right.
‫So thanks a lot and see you in the next video.