Hello and welcome.
In this lecture we are going to learn about concatenate in list concatenation.
Basically means adding together.
So I am going to quickly just create another list here.
I'm going to create a list called vegetables
so to save time I've just copied this list here and I'm just going to change the name Sarge changed
up from fruits to vegetables
please note that the names you gave to your list are case sensitive.
I've used all lowercase here for vegetables so if I try and use an upper case it will not work.
And then I have to change hair stand up from fruits to vegetables.
Okay.
The same thing here.
Okay.
So I just need to change the name of the vegetables
so I add I'll say carrots.
Call me and say
corn or tomato
okay.
So I now have to list.
First one is called a fruit.
Second is called vegetable.
So to concatenate both lists that means to add the list together.
We use what is what is called an add range.
So to do that to add them together will going to add the this vegetable is going to add that to the
fruits.
So what I do a time period fruits
followed by and this is what we used to do the concatenation add range and then in parentheses we pass
in the name of the other list which is vegetables
okay and just put a semicolon at the end there.
All right.
So we are adding You didn't add range method we add in the vegetable list to the fruit list.
So if I do a console the right line on the fruit count I expected to have a count of six.
OK.
Because I've got four listed for fruits and two listed for four vegetables.
So let's give that a go click start and see what comes up with.
If you walks out I should expect a count of six.
There he goes who has walked out.
So we have a count of six so the concatenation has been successful.
So you can try experimenting yourself try and create a couple of lists yourself and then try and concatenate
them.
So that's it for this lecture on C sharp list concatenation.
Thank you for watching.
Bye for now.