Will come back again in this list then we actually have an exercise exercise is this I'm going to set
the stage for you.
So you have two pieces of strings and I want you to find a way to attach them to each other I'm putting
them together.
That's essentially called apprehending or concatenating two pieces of things to each other.
So let me go to exclude him.
I'm going to start a new project say new project and this new project come on by and or is called the
strings and in my hand the strings.
And this is the staging part of the I'm going to do for you is going to be like this is going to be
one of those is going to be a string string one that says hello and it's going to be a string ring true
that says War.
So then once you do is this I want you to find a way that when you print this if you print the two of
them together so it says something like Hello world.
I put the little space between them.
So good luck and post the video here.
Try it on your own.
And then I'm going to go through that and I'm going to do it in multiple different ways.
So we get a sense of so many different you know things in OK.
I hope you succeeded and here's how I'm going to do it.
I'm going to do it in several different ways.
One of them would be the simplest one with Beatty's and Aslaug and then a slowdown would say there is
one object there is on space between them.
And then there is another object and then I'm going to say the string one on the string too.
So essentially says preens what ever you'll find in this one with a little less space between them and
then whatever you find in the other one that's printed out and see if it works.
And now we have done hello or two separate ones.
There's a space between them.
This isn't however as funky as the next one.
The next one is going to be like this.
I'm going to say this thing let's call this one result of a string.
This is the resist thing which is going to be a string string.
Format in this thing with format I'm going to say essentially the same thing.
I have one piece in space and I have another piece and the two pieces are a string one on the string
two.
So now I have a new string which is called resolve the string.
The result the string is the result of being.
This one is space and the next one.
And of course I can now print that one.
So I'm going to say and Aslaug what ever you'll find in resolve the string.
So bring this here.
Let's say this is first my third.
This one is second method.
Thank you.
So let's do that.
So we be expected.
The boss are of printing the same thing.
I could actually play a little cheating here and say first method is that and then say second method
is out of place in the wrong place.
After all the quotation marks of course.
And now if you play or if you run the harp It says first method says your second mother says hello world.
Now let's see another way of doing the exact same thing on this one I'm going to call her method and
my method here's what I'm going to do.
I'm going to say this thing or let's call it here.
RAZ This ring her resolve this thing gets going to be my dream girl.
One myth is read by appending a string and what do what happens with what happens with a string.
So at the second string to the first string.
Once again there is a string which is the result of appending the string to string one.
And I should add a semicolon in my den in here let's print this one.
Let's see if this one actually works on their method is Taro's resolve the string.
What do you think is going to happen when I hit the wrong button.
Let's see together.
Yes Ron.
And it does print but it doesn't have the little space to expected it.
So here's what we could do.
I could say first get the string one and append this through in a space.
So by now here the result the string should be saying hello and a space then I'm going to say hello
resolve the string is a tear.
Resolve to string the string by appending the string to.
So they get added to each other.
Now this is a very important concept.
Let's see the result and then I will explain it in a second so it prints it properly the way we want
it.
And now let me talk about that thing that I said.
It's very important here.
Result.
The string is here.
The result the string which is something that's easier and a simpler example of it in my hand is three.
And then I'm going to say my hand is my in plus five.
What does that mean.
Is it if you show this through your high school teacher they would freak out because they would tell
you.
How can one side of an equation be the same thing plus something else.
But that's the thing in programming.
This isn't really a sign of equality.
Rather it is a sign of assignments not the quality but the assignments.
It means take whatever is on the right side of the assignments.
Do the math on it.
Do whatever you want to do to it and then assign it to the left side.
So in this case it will be three plus five.
That is AIDS and 8 cause might it becomes a mistake here there isn't this thing becomes what ever is
in here.
Resolve the string of pens to eat something else and then put it back in the territories or this string.
Now if you're wondering what is the practical example of such a thing.
Let me give you an example.
Remember we had an integer play.
Our turn of play or play or something like the effect that was essentially how many times player had
played a round of play round of play let's say round of play is 0 and then player plays once then we
say around of play these round of play plus 1.
So it gets added to it.
Let's say now the player has played.
I don't know.
Sixty five times and then it says round of play is 65 plus 1.
So round of play becomes 66.
So it keeps counting up walks towards whatever it is that you're trying to do.
So this is a very common practice.
Another common practice that's just of the building blocks of doing programming.
It is essentially called assignment.
Everywhere that you see an equal sign it's a sign of assignment.
It doesn't mean that the side is equal to that side.
It means the left side should become what is on the right side the left side should become what is on
the right side of the equation.
So that's about that.
Before I finished this lesson I want to introduce you to an new concept as well.
And that's the concept of mutable values.
You see so far we had a string.
But now I want to show you something called an as mutable string.
And the difference between an and assisting an end is mutable a thing is that anything that is mutable.
It means it can be modified so you can essentially say mutable means means more before any of that.
So I know that we could actually take a string and put a value in it and then assign something else
to it.
For instance up here we could say a string one is low and then again we could say this thing 1 is not
hello.
What we couldn't do is go with this a specific characters and change them.
You couldn't say whatever is the value in this thing.
Go and find the one that says and modify that.
And that is what we can do with immutable strings with mutable things.
We can modify whatever is currently in them.
So let's go ahead and make a new one.
And it's interesting my mutable string.
I'm going to give it a value such as my name for instance keep in mind that this is a wrong way of defining
immutable strings because mutable things can not by default become strings and that's why it's giving
me a warning.
The correct way of doing this is this instead of that I'm going to have to write in as mutable a string
as to with a string.
So it's thought with a string based on a string of characters and what are those characters.
It's essentially going to be mining.
Or if you want in our case it could be a strange one.
So I'm making immutable a string based on a string one.
And then I could do things such as this I would say my immutable string.
Append a string.
What do I want out then.
I want to append the space.
And then I would say my mutable string.
Append a string.
Then what happened to it when I opened the string two treats.
So this is essentially modifying the existing one on like the last time that we actually had to assign
the value entirely saying whatever is in your add to that little bit too.
And that's essentially a concept of mutability in Objective-C see a lot more of this when we talk about
the collections specifically when we talk about N.S. arrays and as mutable arrays but they just want
you to get a sense of what it means for something to be mutable.
Don't be don't be puzzled by the term if the term is difficult for you just consider it as modifiable.
So if something is mutable it means it can be modified its contents can be modified as you can imagine
if I call this one my fourth method fight going on I say and it's like for all your self-worth.
I hope so.
My immutable string.
Let's run it.
And down in meannesses forth metod also has become Hello world.
So that's about that.
Let me zoom into it in a way that if you want to spend some time on it I can pause the video here for
a few seconds and you can pause based on that once you're good with this.
Let's move on to our next list.
And there we use some of these learnings into using it using an actual iOS application.
So I'll see you there.