1 00:00:00,240 --> 00:00:02,680 Strings immutable. 2 00:00:02,700 --> 00:00:09,230 This means that elements of a string cannot be changed once it has been assigned. 3 00:00:13,070 --> 00:00:24,550 Say for example you want to change the letter Y the Character Y in the string a country to E. 4 00:00:24,550 --> 00:00:26,350 So let's see if we can do that. 5 00:00:29,100 --> 00:00:46,090 String 1 0 6 let's try and change it to the character e so the interpreter has drawn a letter saying 6 00:00:46,090 --> 00:00:50,390 that the string object does not support item assignment. 7 00:00:50,440 --> 00:00:56,200 That means you can not change any of the elements within the string. 8 00:00:56,260 --> 00:01:02,890 Until now we have performed a lot of operations like indexing or slicing on the string. 9 00:01:03,190 --> 00:01:07,920 So did we change the value of the original string. 10 00:01:07,930 --> 00:01:15,600 Let us check that so this is a word or orginally string SD. 11 00:01:15,610 --> 00:01:16,380 Odd one. 12 00:01:16,400 --> 00:01:22,030 So we have done a lot of slicing operations on this particular string. 13 00:01:22,040 --> 00:01:24,260 Let's see if it has changed or not. 14 00:01:26,130 --> 00:01:35,480 Note it is the same as we have deplaned so for String objects all of the different functions and method 15 00:01:35,510 --> 00:01:40,910 that we call on a string do not affect the original string value 16 00:01:44,050 --> 00:01:50,080 but what we can do is create a new string that is a variation of the original. 17 00:01:51,040 --> 00:02:03,550 So like integers and plotting by numbers String objects are immutable so we have a string a defined 18 00:02:04,750 --> 00:02:06,020 as happy. 19 00:02:06,070 --> 00:02:10,830 Now I want to change the text to be happy 20 00:02:14,000 --> 00:02:16,600 but as put our discussions. 21 00:02:16,910 --> 00:02:25,010 String red bills are immutable so we cannot change any of the characters in the variable that has already 22 00:02:25,010 --> 00:02:26,270 been defined. 23 00:02:26,450 --> 00:02:38,030 So in order to have this text displayed I'm going to create a model variable B which bind to the text 24 00:02:38,180 --> 00:02:38,900 b e 25 00:02:42,300 --> 00:02:51,100 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 26 00:02:51,630 --> 00:03:04,810 the strings B and A in case of numbers the plus operator will be an operator for additions but when 27 00:03:04,840 --> 00:03:08,910 it is used with strings it is a joining operator. 28 00:03:09,010 --> 00:03:13,770 So the variable C will now bind to the text. 29 00:03:14,610 --> 00:03:15,230 B. 30 00:03:21,790 --> 00:03:27,520 And this joining all four strings together. 31 00:03:27,550 --> 00:03:35,890 End to end to create a new string is known as concatenation and for concatenation we use the less operator 32 00:03:36,960 --> 00:03:46,980 so concatenation is joining of two or more strings into a single one to concatenate two strings in the 33 00:03:46,980 --> 00:03:56,840 Jupiter note so we have variable E which is binding to the text. 34 00:03:56,830 --> 00:04:03,900 B let's define another way to build B with two B. 35 00:04:07,090 --> 00:04:12,770 Net concatenate the two strings 36 00:04:15,300 --> 00:04:25,490 and then c so C is now pointing to this text if you want to have a space included between these two 37 00:04:26,510 --> 00:04:27,200 strings. 38 00:04:27,200 --> 00:04:30,880 In that case you can have a space when would define B. 39 00:04:32,030 --> 00:04:38,070 And then execute so she is now binding to the text. 40 00:04:38,220 --> 00:04:39,430 Be happy. 41 00:04:41,630 --> 00:04:48,680 Writing to string literally together also concatenate them like the plus operator. 42 00:04:48,980 --> 00:04:55,180 Say for example if we bind the strings. 43 00:04:55,330 --> 00:04:56,170 B. 44 00:04:57,770 --> 00:04:59,970 And happy together. 45 00:04:59,970 --> 00:05:07,470 The interpreter will automatically concatenate them and give the output as one single liquid and be 46 00:05:07,470 --> 00:05:08,820 happy. 47 00:05:08,820 --> 00:05:13,010 This is about the concatenation the next topic. 48 00:05:13,020 --> 00:05:22,010 String the replication the start operator is useful string the application and this can be used to repeat 49 00:05:22,070 --> 00:05:34,470 a string for a given number of times so let's repeat the string a five times using the string replication 50 00:05:34,500 --> 00:05:35,470 operator. 51 00:05:35,850 --> 00:05:44,970 So that string replication we can repeat the single string value the amount of times equal into the 52 00:05:45,030 --> 00:05:45,960 integer value.