1 00:00:01,230 --> 00:00:02,440 This is so hard. 2 00:00:02,440 --> 00:00:06,470 Once again welcome to the next value of Codlin programming series. 3 00:00:06,490 --> 00:00:12,910 Now in this video we will learn about Vought our string templates or in other words what is string in 4 00:00:12,910 --> 00:00:14,410 the pollution. 5 00:00:14,510 --> 00:00:20,300 Now in case of Cartland we have a special type of concept of string in the pollution. 6 00:00:20,320 --> 00:00:22,870 So for that latest dig some example. 7 00:00:22,900 --> 00:00:25,230 So there does define some value. 8 00:00:25,240 --> 00:00:34,280 Let's see valid species name equal to Sam and then let us define and undervalue such as that SPEEs SDR 9 00:00:34,390 --> 00:00:38,950 equal to hello space and then a band name at the end. 10 00:00:39,310 --> 00:00:42,670 Now here let us print it by using acedia. 11 00:00:42,910 --> 00:00:44,550 So the output we will get. 12 00:00:44,620 --> 00:00:45,450 Hello Sam. 13 00:00:45,490 --> 00:00:46,880 As expected. 14 00:00:47,350 --> 00:00:48,570 So here is the output. 15 00:00:48,640 --> 00:00:49,590 Hello Sam. 16 00:00:49,620 --> 00:00:56,440 Now in Scotland we have a special concept of string in the pollution that is we no longer need to use 17 00:00:56,500 --> 00:00:59,970 the plus keyword or the string concatenation. 18 00:00:59,980 --> 00:01:02,080 Now what is string interpellation. 19 00:01:02,080 --> 00:01:06,570 So far this VIGEN simply remove name from here and we didn't. 20 00:01:06,580 --> 00:01:11,940 Hello we can simply use our dollar symbol followed by name. 21 00:01:12,260 --> 00:01:14,620 So the Java compiler I've ordered will do. 22 00:01:14,650 --> 00:01:17,830 It will simply evaluate name and then put in. 23 00:01:17,940 --> 00:01:20,110 Hello friend of Sam. 24 00:01:20,110 --> 00:01:22,420 So let us know in the code. 25 00:01:22,420 --> 00:01:24,360 So here in the output we get. 26 00:01:24,400 --> 00:01:25,210 Hello Sam. 27 00:01:25,210 --> 00:01:28,780 As expected as we got in the previous run. 28 00:01:28,840 --> 00:01:30,860 Now let us take some more example. 29 00:01:30,880 --> 00:01:35,260 We can also apply in the Felician for this SDR very well right. 30 00:01:35,260 --> 00:01:36,510 So here is what they will do. 31 00:01:36,640 --> 00:01:38,400 I will simply print a statement. 32 00:01:38,470 --> 00:01:43,970 The statement is less SDR now instead of using the plus SD or here. 33 00:01:44,020 --> 00:01:48,140 You can also use our donor symbol followed by SDR. 34 00:01:48,250 --> 00:01:53,890 But I would simply remove the plus SDR from here so the output will get. 35 00:01:53,890 --> 00:01:54,960 The statement is. 36 00:01:55,030 --> 00:01:56,650 Hello Sam. 37 00:01:56,720 --> 00:01:58,120 So here is the output. 38 00:01:58,130 --> 00:01:59,190 The statement is. 39 00:01:59,210 --> 00:02:00,020 Hello Sam. 40 00:02:00,140 --> 00:02:01,630 And now proceeding forward. 41 00:02:01,640 --> 00:02:05,950 Let's just take one example such as that statement is. 42 00:02:05,990 --> 00:02:06,830 Hello Sam. 43 00:02:06,860 --> 00:02:19,930 And then full stop forward by the number of characters in statement is see name is SDR darlin that is. 44 00:02:19,940 --> 00:02:23,100 This will simply return the length of the string. 45 00:02:23,240 --> 00:02:26,240 So here I will use are dollar symbol. 46 00:02:26,240 --> 00:02:31,350 Now whenever we use a donor symbol it is only applicable for the variable. 47 00:02:31,370 --> 00:02:32,660 Right after this. 48 00:02:32,780 --> 00:02:36,740 So this donor symbol is only applicable for this SDR. 49 00:02:36,950 --> 00:02:39,590 So let's see what happens in the output. 50 00:02:39,620 --> 00:02:43,730 So in output we get the number of characters in the statement is. 51 00:02:43,940 --> 00:02:45,630 Hello Sam dark darkling. 52 00:02:45,720 --> 00:02:52,400 But our objective was to print the number of characters present inside this statement that is. 53 00:02:52,450 --> 00:02:53,340 Hello Sam. 54 00:02:53,360 --> 00:02:58,180 So far that we need to apply the end of pollution on this land very well. 55 00:02:58,420 --> 00:03:05,510 And now this land is actually dependent on this SDR string so we cannot apply their dollar symbol right 56 00:03:05,510 --> 00:03:07,130 here like this. 57 00:03:07,130 --> 00:03:09,020 This will simply desert an. 58 00:03:09,320 --> 00:03:15,030 So far this we need to simply use the curly bracket open and then are the end blues. 59 00:03:15,140 --> 00:03:16,600 So the Codlin compiler. 60 00:03:16,640 --> 00:03:17,480 What do we do. 61 00:03:17,480 --> 00:03:24,800 It will simply evaluate this statement here and then apply the encapsulation on whole right that is 62 00:03:24,880 --> 00:03:26,030 learned. 63 00:03:26,210 --> 00:03:28,810 So let us know execute our record. 64 00:03:29,020 --> 00:03:32,790 So here we go the number of characters in the statement is 9. 65 00:03:32,860 --> 00:03:39,280 So this statement is actually actually contains nine characters now proceeding forward. 66 00:03:39,280 --> 00:03:41,410 Let us take some more example. 67 00:03:41,470 --> 00:03:43,190 Let's see Val a. 68 00:03:43,330 --> 00:03:44,810 Equal to 10. 69 00:03:45,160 --> 00:03:48,530 And then they'll be equal to 5. 70 00:03:48,760 --> 00:03:56,290 And now let us print something the sum of a and b is something. 71 00:03:56,360 --> 00:04:01,260 So I want to print the number of variable A and also the number variable B. 72 00:04:01,360 --> 00:04:04,400 And also I want to bring some of these two numbers. 73 00:04:04,540 --> 00:04:10,440 So with the help of intercalation what you can do we can simply apply their donor symbol here and also 74 00:04:10,510 --> 00:04:12,200 our donor symbol here. 75 00:04:12,370 --> 00:04:18,110 And then we can simply apply donor symbol here and simply type E-plus b.. 76 00:04:18,160 --> 00:04:21,480 Now ask for the stuff that you saw in the previous example. 77 00:04:21,580 --> 00:04:29,100 This donor symbol is only applicable for a but I want to execute the interpellation as a whole here. 78 00:04:29,230 --> 00:04:35,230 So for this we need to again use the curly bracket open and then curly bracket close. 79 00:04:35,470 --> 00:04:42,270 And now let us run our called so in the output we get the sum of and 5 is 15. 80 00:04:42,270 --> 00:04:46,000 Now this is the beauty of Cartland in just vuln statement. 81 00:04:46,020 --> 00:04:47,700 You can play and everything. 82 00:04:47,700 --> 00:04:53,750 So that is why you see the Cartland is more powerful than Java and it is more expressive and concise 83 00:04:54,030 --> 00:04:56,850 less number of code but more output. 84 00:04:56,850 --> 00:05:02,630 Apart from this if Suppose we defined the class let's see rectangle. 85 00:05:02,670 --> 00:05:07,490 Now please don't worry we will discuss about the class in our upcoming mortuis as of no. 86 00:05:07,500 --> 00:05:09,830 I'm simply giving you an example. 87 00:05:09,940 --> 00:05:16,510 Legacy lende colon and others are defined a bit call on an equal to zero. 88 00:05:16,560 --> 00:05:18,500 And now here insert the pinch statement. 89 00:05:18,540 --> 00:05:21,920 I want to print the length of the rectangle is this much and inbread. 90 00:05:21,930 --> 00:05:25,980 Is this much and the idea of the rectangle is lende interbred. 91 00:05:26,040 --> 00:05:29,770 So I want to print a value in just one print statement. 92 00:05:29,940 --> 00:05:34,770 So for this day I really do I would simply create a rectangle equal to. 93 00:05:34,800 --> 00:05:36,600 Let's create a new object. 94 00:05:36,600 --> 00:05:41,820 Now these are some basic steps that we already saw in the previous Mordy will right now. 95 00:05:41,830 --> 00:05:48,770 Here I would simply initialize correct Dorte lend equal to 5. 96 00:05:49,030 --> 00:05:53,160 And Rick dord lent equal or to 3. 97 00:05:53,380 --> 00:06:00,770 And now here I would simply use the interpellation So in place offline I would simply use Project dot 98 00:06:01,480 --> 00:06:05,980 what did and simply apply that into pollution on Hall. 99 00:06:06,060 --> 00:06:08,840 So we need to use the curly bracket here. 100 00:06:10,270 --> 00:06:12,090 And then close it. 101 00:06:12,100 --> 00:06:15,420 And don't forget to put the dollar sign here right. 102 00:06:15,490 --> 00:06:21,030 Similarly dollar symbol daughters in will here. 103 00:06:21,690 --> 00:06:23,590 Blackard open and close. 104 00:06:24,010 --> 00:06:27,050 And now the next door. 105 00:06:27,970 --> 00:06:34,620 And then the area of the rectangle is legacy dollar that backward open and close next door. 106 00:06:34,700 --> 00:06:40,050 Len ESTRICH But I don't it fine. 107 00:06:40,090 --> 00:06:47,310 And now let us turn our call in the output we get the length of the rectangle is five breadth is three. 108 00:06:47,320 --> 00:06:49,740 And the area is 15. 109 00:06:49,750 --> 00:06:56,160 So how beautifully We have simply applied to the pollution and rendered our the output in just one statement. 110 00:06:56,190 --> 00:06:56,890 Right. 111 00:06:57,340 --> 00:07:00,490 So this was all about the strength blade in Cartland.