1 00:00:00,180 --> 00:00:00,600 Okay. 2 00:00:00,600 --> 00:00:02,340 So you made it to the end, hopefully. 3 00:00:02,340 --> 00:00:06,330 I mean, I guess you could have skipped forward, but you made it to this video however you got here 4 00:00:06,750 --> 00:00:09,030 at the end of the string function section. 5 00:00:09,210 --> 00:00:15,510 So we have a couple of exercises and they range from pretty straightforward to reasonably complex where 6 00:00:15,510 --> 00:00:18,030 we combine multiple string functions together. 7 00:00:18,090 --> 00:00:19,410 So let's get started. 8 00:00:20,100 --> 00:00:27,090 The first one here is to reverse and uppercase the following sentence Why does my cat look at me with 9 00:00:27,090 --> 00:00:28,200 such hatred? 10 00:00:29,970 --> 00:00:33,450 I would also appreciate an answer to that if anyone can help me. 11 00:00:34,020 --> 00:00:36,630 But anyways, what we need to do is just take this. 12 00:00:36,630 --> 00:00:40,740 You can copy it or type it out and just use my as well. 13 00:00:40,740 --> 00:00:44,700 I should specify, don't just manually reverse it and type it uppercase. 14 00:00:44,700 --> 00:00:48,720 I mean, using what you just learned, how can you reverse an uppercase this. 15 00:00:49,590 --> 00:00:54,990 All right then when you're done with that, the next problem, this one is a little different. 16 00:00:54,990 --> 00:00:57,930 You don't have to actually do anything I want you to do. 17 00:00:57,930 --> 00:00:59,910 Figure out what this prints out. 18 00:01:00,660 --> 00:01:03,630 So don't just cheat and copy and paste it. 19 00:01:03,660 --> 00:01:08,340 You can do that to check your work, of course, but try and work through what's actually happening. 20 00:01:08,340 --> 00:01:14,190 We've got to select, we've got to replace and it can cat and some words and spaces and symbols and 21 00:01:14,190 --> 00:01:14,880 dashes. 22 00:01:15,270 --> 00:01:23,490 So give it a shot, then move on to the next one here, which is to replace all the spaces in book titles. 23 00:01:23,640 --> 00:01:29,460 With this little arrow, it's a dash greater than sign, so replace every space. 24 00:01:29,460 --> 00:01:35,130 So instead of the space namesake, it's the dash, or let's just say arrow the arrow namesake. 25 00:01:35,130 --> 00:01:37,650 And that happens for every space. 26 00:01:38,820 --> 00:01:42,630 And one more thing I'll call attention to is up here, it just says title. 27 00:01:43,230 --> 00:01:47,190 So you're going to need to use as to make sure it says title. 28 00:01:47,280 --> 00:01:53,580 So basically your task is to just get this same data printed out, this exact same format. 29 00:01:54,510 --> 00:01:57,480 Then after that, print this out. 30 00:01:58,110 --> 00:02:06,750 So you're going to have the author's last name printed regularly forwards, and then next to it you'll 31 00:02:06,750 --> 00:02:12,420 have the same author's name printed backwards, in reverse, you might say. 32 00:02:12,900 --> 00:02:14,400 So that's what you need to do. 33 00:02:14,760 --> 00:02:16,050 Also, pay attention up here. 34 00:02:16,050 --> 00:02:19,920 It says forwards and backwards, so you'll need to use as again to do that. 35 00:02:20,550 --> 00:02:27,480 Then once you do that, the next one like you to print out a full author's name. 36 00:02:27,660 --> 00:02:30,600 So it's a little more complicated in caps. 37 00:02:30,810 --> 00:02:32,940 So we want Jhumpa Lahiri. 38 00:02:32,940 --> 00:02:39,330 So that's author first name and last name combined and uppercase, and that should happen for every 39 00:02:39,330 --> 00:02:39,990 author. 40 00:02:40,230 --> 00:02:45,840 And then also again, the name appears or the header says full name in caps. 41 00:02:46,800 --> 00:02:50,250 All right, then make this happen. 42 00:02:50,520 --> 00:02:59,970 So what this is showing is a title The Namesake and then was released in and then the actual date that 43 00:02:59,970 --> 00:03:02,370 we have stored in our database for when it was released. 44 00:03:02,760 --> 00:03:10,350 So you need to combine a title was released in and then the year it was released and again I called 45 00:03:10,350 --> 00:03:13,350 it Blurb but just put some label up there. 46 00:03:14,710 --> 00:03:22,210 Then next one here, print book titles and the length of each title, which is pretty similar to what 47 00:03:22,210 --> 00:03:25,390 I had, what I did using authors last names. 48 00:03:25,390 --> 00:03:30,440 So just print the title and then the number of characters in that title. 49 00:03:30,460 --> 00:03:32,200 As you can see, some of them are quite long. 50 00:03:33,190 --> 00:03:36,640 The only other thing I would say is up here I pay attention. 51 00:03:36,640 --> 00:03:40,870 We have character count, so use as you get it by now. 52 00:03:42,070 --> 00:03:46,630 Then finally, this one combines three different pieces of data. 53 00:03:47,180 --> 00:03:49,090 We'd like to have a shortened title. 54 00:03:50,230 --> 00:03:52,000 So I believe this is ten characters. 55 00:03:52,000 --> 00:03:54,940 One, two, three, four, five, six, seven, eight, nine. 56 00:03:54,940 --> 00:03:55,270 Yes. 57 00:03:55,270 --> 00:04:04,540 So the first ten characters and then a dot, dot, dot afterwards and call that short title, then we'll 58 00:04:04,540 --> 00:04:05,800 have the author print it out. 59 00:04:05,800 --> 00:04:08,500 But the way it should be printed is last name. 60 00:04:08,500 --> 00:04:11,590 Followed by a comma, followed by first name. 61 00:04:13,200 --> 00:04:15,300 And then quantity. 62 00:04:15,570 --> 00:04:22,260 So quantity should not just be the number we have in stock, but it should be the sentence 12 in stock 63 00:04:22,260 --> 00:04:23,760 or 104 in stock. 64 00:04:23,940 --> 00:04:30,630 So there's a lot of pieces here, and each one of these three is going to require multiple string functions 65 00:04:30,630 --> 00:04:31,560 to make it work. 66 00:04:32,250 --> 00:04:33,540 So give it a shot. 67 00:04:34,170 --> 00:04:35,820 This one is a little more challenging. 68 00:04:35,820 --> 00:04:39,720 So don't panic again if you don't get it, but try them all out. 69 00:04:39,720 --> 00:04:42,270 And then in the next video we'll have solutions.