Strings immutable.
This means that elements of a string cannot be changed once it has been assigned.
Say for example you want to change the letter Y the Character Y in the string a country to E.
So let's see if we can do that.
String 1 0 6 let's try and change it to the character e so the interpreter has drawn a letter saying
that the string object does not support item assignment.
That means you can not change any of the elements within the string.
Until now we have performed a lot of operations like indexing or slicing on the string.
So did we change the value of the original string.
Let us check that so this is a word or orginally string SD.
Odd one.
So we have done a lot of slicing operations on this particular string.
Let's see if it has changed or not.
Note it is the same as we have deplaned so for String objects all of the different functions and method
that we call on a string do not affect the original string value
but what we can do is create a new string that is a variation of the original.
So like integers and plotting by numbers String objects are immutable so we have a string a defined
as happy.
Now I want to change the text to be happy
but as put our discussions.
String red bills are immutable so we cannot change any of the characters in the variable that has already
been defined.
So in order to have this text displayed I'm going to create a model variable B which bind to the text
b e
so I'm not going to change the order journal dream what I'm going to do is I'm going to contact in need
the strings B and A in case of numbers the plus operator will be an operator for additions but when
it is used with strings it is a joining operator.
So the variable C will now bind to the text.
B.
And this joining all four strings together.
End to end to create a new string is known as concatenation and for concatenation we use the less operator
so concatenation is joining of two or more strings into a single one to concatenate two strings in the
Jupiter note so we have variable E which is binding to the text.
B let's define another way to build B with two B.
Net concatenate the two strings
and then c so C is now pointing to this text if you want to have a space included between these two
strings.
In that case you can have a space when would define B.
And then execute so she is now binding to the text.
Be happy.
Writing to string literally together also concatenate them like the plus operator.
Say for example if we bind the strings.
B.
And happy together.
The interpreter will automatically concatenate them and give the output as one single liquid and be
happy.
This is about the concatenation the next topic.
String the replication the start operator is useful string the application and this can be used to repeat
a string for a given number of times so let's repeat the string a five times using the string replication
operator.
So that string replication we can repeat the single string value the amount of times equal into the
integer value.