Okay.
So you made it to the end, hopefully.
I mean, I guess you could have skipped forward, but you made it to this video however you got here
at the end of the string function section.
So we have a couple of exercises and they range from pretty straightforward to reasonably complex where
we combine multiple string functions together.
So let's get started.
The first one here is to reverse and uppercase the following sentence Why does my cat look at me with
such hatred?
I would also appreciate an answer to that if anyone can help me.
But anyways, what we need to do is just take this.
You can copy it or type it out and just use my as well.
I should specify, don't just manually reverse it and type it uppercase.
I mean, using what you just learned, how can you reverse an uppercase this.
All right then when you're done with that, the next problem, this one is a little different.
You don't have to actually do anything I want you to do.
Figure out what this prints out.
So don't just cheat and copy and paste it.
You can do that to check your work, of course, but try and work through what's actually happening.
We've got to select, we've got to replace and it can cat and some words and spaces and symbols and
dashes.
So give it a shot, then move on to the next one here, which is to replace all the spaces in book titles.
With this little arrow, it's a dash greater than sign, so replace every space.
So instead of the space namesake, it's the dash, or let's just say arrow the arrow namesake.
And that happens for every space.
And one more thing I'll call attention to is up here, it just says title.
So you're going to need to use as to make sure it says title.
So basically your task is to just get this same data printed out, this exact same format.
Then after that, print this out.
So you're going to have the author's last name printed regularly forwards, and then next to it you'll
have the same author's name printed backwards, in reverse, you might say.
So that's what you need to do.
Also, pay attention up here.
It says forwards and backwards, so you'll need to use as again to do that.
Then once you do that, the next one like you to print out a full author's name.
So it's a little more complicated in caps.
So we want Jhumpa Lahiri.
So that's author first name and last name combined and uppercase, and that should happen for every
author.
And then also again, the name appears or the header says full name in caps.
All right, then make this happen.
So what this is showing is a title The Namesake and then was released in and then the actual date that
we have stored in our database for when it was released.
So you need to combine a title was released in and then the year it was released and again I called
it Blurb but just put some label up there.
Then next one here, print book titles and the length of each title, which is pretty similar to what
I had, what I did using authors last names.
So just print the title and then the number of characters in that title.
As you can see, some of them are quite long.
The only other thing I would say is up here I pay attention.
We have character count, so use as you get it by now.
Then finally, this one combines three different pieces of data.
We'd like to have a shortened title.
So I believe this is ten characters.
One, two, three, four, five, six, seven, eight, nine.
Yes.
So the first ten characters and then a dot, dot, dot afterwards and call that short title, then we'll
have the author print it out.
But the way it should be printed is last name.
Followed by a comma, followed by first name.
And then quantity.
So quantity should not just be the number we have in stock, but it should be the sentence 12 in stock
or 104 in stock.
So there's a lot of pieces here, and each one of these three is going to require multiple string functions
to make it work.
So give it a shot.
This one is a little more challenging.
So don't panic again if you don't get it, but try them all out.
And then in the next video we'll have solutions.