This is so hard.
Once again welcome to the next value of Codlin programming series.
Now in this video we will learn about Vought our string templates or in other words what is string in
the pollution.
Now in case of Cartland we have a special type of concept of string in the pollution.
So for that latest dig some example.
So there does define some value.
Let's see valid species name equal to Sam and then let us define and undervalue such as that SPEEs SDR
equal to hello space and then a band name at the end.
Now here let us print it by using acedia.
So the output we will get.
Hello Sam.
As expected.
So here is the output.
Hello Sam.
Now in Scotland we have a special concept of string in the pollution that is we no longer need to use
the plus keyword or the string concatenation.
Now what is string interpellation.
So far this VIGEN simply remove name from here and we didn't.
Hello we can simply use our dollar symbol followed by name.
So the Java compiler I've ordered will do.
It will simply evaluate name and then put in.
Hello friend of Sam.
So let us know in the code.
So here in the output we get.
Hello Sam.
As expected as we got in the previous run.
Now let us take some more example.
We can also apply in the Felician for this SDR very well right.
So here is what they will do.
I will simply print a statement.
The statement is less SDR now instead of using the plus SD or here.
You can also use our donor symbol followed by SDR.
But I would simply remove the plus SDR from here so the output will get.
The statement is.
Hello Sam.
So here is the output.
The statement is.
Hello Sam.
And now proceeding forward.
Let's just take one example such as that statement is.
Hello Sam.
And then full stop forward by the number of characters in statement is see name is SDR darlin that is.
This will simply return the length of the string.
So here I will use are dollar symbol.
Now whenever we use a donor symbol it is only applicable for the variable.
Right after this.
So this donor symbol is only applicable for this SDR.
So let's see what happens in the output.
So in output we get the number of characters in the statement is.
Hello Sam dark darkling.
But our objective was to print the number of characters present inside this statement that is.
Hello Sam.
So far that we need to apply the end of pollution on this land very well.
And now this land is actually dependent on this SDR string so we cannot apply their dollar symbol right
here like this.
This will simply desert an.
So far this we need to simply use the curly bracket open and then are the end blues.
So the Codlin compiler.
What do we do.
It will simply evaluate this statement here and then apply the encapsulation on whole right that is
learned.
So let us know execute our record.
So here we go the number of characters in the statement is 9.
So this statement is actually actually contains nine characters now proceeding forward.
Let us take some more example.
Let's see Val a.
Equal to 10.
And then they'll be equal to 5.
And now let us print something the sum of a and b is something.
So I want to print the number of variable A and also the number variable B.
And also I want to bring some of these two numbers.
So with the help of intercalation what you can do we can simply apply their donor symbol here and also
our donor symbol here.
And then we can simply apply donor symbol here and simply type E-plus b..
Now ask for the stuff that you saw in the previous example.
This donor symbol is only applicable for a but I want to execute the interpellation as a whole here.
So for this we need to again use the curly bracket open and then curly bracket close.
And now let us run our called so in the output we get the sum of and 5 is 15.
Now this is the beauty of Cartland in just vuln statement.
You can play and everything.
So that is why you see the Cartland is more powerful than Java and it is more expressive and concise
less number of code but more output.
Apart from this if Suppose we defined the class let's see rectangle.
Now please don't worry we will discuss about the class in our upcoming mortuis as of no.
I'm simply giving you an example.
Legacy lende colon and others are defined a bit call on an equal to zero.
And now here insert the pinch statement.
I want to print the length of the rectangle is this much and inbread.
Is this much and the idea of the rectangle is lende interbred.
So I want to print a value in just one print statement.
So for this day I really do I would simply create a rectangle equal to.
Let's create a new object.
Now these are some basic steps that we already saw in the previous Mordy will right now.
Here I would simply initialize correct Dorte lend equal to 5.
And Rick dord lent equal or to 3.
And now here I would simply use the interpellation So in place offline I would simply use Project dot
what did and simply apply that into pollution on Hall.
So we need to use the curly bracket here.
And then close it.
And don't forget to put the dollar sign here right.
Similarly dollar symbol daughters in will here.
Blackard open and close.
And now the next door.
And then the area of the rectangle is legacy dollar that backward open and close next door.
Len ESTRICH But I don't it fine.
And now let us turn our call in the output we get the length of the rectangle is five breadth is three.
And the area is 15.
So how beautifully We have simply applied to the pollution and rendered our the output in just one statement.
Right.
So this was all about the strength blade in Cartland.