1
00:00:00,660 --> 00:00:04,290
In this video we'll be looking at string manipulation in C sharp.

2
00:00:04,290 --> 00:00:09,730
I've already created my project and the name of the project is string manipulation so you may pause

3
00:00:09,730 --> 00:00:13,750
the video here and create your console application project.

4
00:00:13,760 --> 00:00:17,810
Call it string manipulation and then we can pick up from there.

5
00:00:17,810 --> 00:00:23,130
Now today we just want to focus on some of the tips and tricks and quick ways to process strings in

6
00:00:23,130 --> 00:00:28,000
C sharp no strings are an essential part of any programming language they represent.

7
00:00:28,200 --> 00:00:33,570
Well I would say 90 percent of the content that would be passing through your application everything

8
00:00:33,570 --> 00:00:37,920
that is input into your program through the use of a keyboard pretty much comes in as a string.

9
00:00:37,920 --> 00:00:42,840
And it is important to understand the tools that C Sharp has available to us.

10
00:00:42,840 --> 00:00:48,870
Now I've started off by declaring a string variable and I'm calling it full name and I have a sentence

11
00:00:48,870 --> 00:00:49,080
here.

12
00:00:49,080 --> 00:00:53,820
My name is and I have a spelling error is Trevor Williams.

13
00:00:53,940 --> 00:00:58,670
Now we've been doing this for a while now and if not then that's fine to print to screen.

14
00:00:58,680 --> 00:01:04,760
We say console which is a static class given to us by C sharp and then we have the function instead

15
00:01:04,760 --> 00:01:11,100
of that static class called the right line and then we specify the string to be printed.

16
00:01:11,100 --> 00:01:17,070
No this string can be something that we're going to type specifically and F string always comes inside

17
00:01:17,100 --> 00:01:25,560
quotation marks or it can be the contents of a variable that is of type String so full name is off type

18
00:01:25,560 --> 00:01:26,670
string.

19
00:01:26,670 --> 00:01:34,350
And of course you have to make sure we get our cases properly and then this will print the contents

20
00:01:34,410 --> 00:01:35,310
of our variable.

21
00:01:35,520 --> 00:01:38,650
So the console lets us test how that works.

22
00:01:38,670 --> 00:01:43,170
So I'm went to change my start up project string manipulation and start.

23
00:01:43,170 --> 00:01:44,040
And there we go.

24
00:01:44,190 --> 00:01:46,530
Hi my name is Trevor Williams.

25
00:01:46,530 --> 00:01:53,680
So our consulate the red line printed the contents of our variable to our console.

26
00:01:53,700 --> 00:01:56,080
Now let's move on to concatenation.

27
00:01:56,080 --> 00:02:01,830
Now I just declared two more variables one called First Name one called last name and then I would like

28
00:02:01,830 --> 00:02:08,550
to print out one contiguous block of string contiguous is another way of seeing continue was and that

29
00:02:08,550 --> 00:02:14,070
string should have my name is and then have the first name and the last name.

30
00:02:14,130 --> 00:02:19,960
So concatenation is the technique by which we join the contents of strings together.

31
00:02:20,010 --> 00:02:25,320
So I'm going to console dot right line and then I'm going to put in some static string and then this

32
00:02:25,320 --> 00:02:30,110
is going to say my full name is.

33
00:02:30,210 --> 00:02:35,250
So when we say static string that means that unless we come into our code and make an adjustment here

34
00:02:35,280 --> 00:02:36,350
this will never change.

35
00:02:36,600 --> 00:02:43,500
However variables are easier to change because then we can use them to collect user inputs and its contents

36
00:02:43,500 --> 00:02:46,620
would be defined based on what is being assigned to it.

37
00:02:46,950 --> 00:02:52,710
However there are times when we want to dynamically print what's in a variable alongside something that

38
00:02:52,710 --> 00:03:00,060
is static so concatenation allows us to join static text onto variable text or variable takes until

39
00:03:00,060 --> 00:03:03,160
variable takes or even a static text on a static text.

40
00:03:03,180 --> 00:03:07,100
The underlying principle is that there are all strings.

41
00:03:07,220 --> 00:03:12,870
Now there are a few ways to concatenate and the first one that I would want to show you is by using

42
00:03:13,100 --> 00:03:15,780
a curly brace and then we're going to close.

43
00:03:15,780 --> 00:03:22,050
So we have curly brace zero and then curly brace and that and when to put the space car to brace one

44
00:03:22,230 --> 00:03:24,260
current a brace no in effect.

45
00:03:24,270 --> 00:03:28,460
These are what you call place holders and they start counting from zero.

46
00:03:28,500 --> 00:03:34,260
So as many placeholders as you have or you're going to create as many playschool as for as many variables

47
00:03:34,260 --> 00:03:39,870
as you'd like to concatenate into the static string and you start counting from zero 0 zero will be

48
00:03:39,870 --> 00:03:44,980
the first one then one the second and the third one would be two.

49
00:03:45,030 --> 00:03:46,790
But then we only have two variables.

50
00:03:46,800 --> 00:03:54,540
So it's zero and one first name and last name not the space is also important because it will print

51
00:03:54,590 --> 00:03:59,870
but the string exactly how it is formatted inside of the quotation marks.

52
00:03:59,880 --> 00:04:06,330
So after placing our place holders there we have to come out of the string and press comma and then

53
00:04:06,330 --> 00:04:11,520
we put in the variables in the very order to match the place holders as intended.

54
00:04:11,520 --> 00:04:17,320
So I want to say my full name is first name and last name.

55
00:04:17,360 --> 00:04:23,390
So that means I need to put the variable that has the content for the first name followed by the variable

56
00:04:23,390 --> 00:04:25,480
that has the content for the last name.

57
00:04:25,580 --> 00:04:32,720
And then this can happen for as many strings as we have so many as many string variables as we have.

58
00:04:32,720 --> 00:04:37,250
Another way to concatenate and I'll just duplicate this nine I just rewrite it.

59
00:04:37,280 --> 00:04:44,560
So console the right line and rewrite our sentence my full name is and then I can use the plus sign.

60
00:04:44,560 --> 00:04:51,820
So I would write my full name is as my static text press the plus sign and there's a first name and

61
00:04:51,820 --> 00:04:58,000
then a plus sign and then because I would want to add a space between the first name and the last name

62
00:04:58,000 --> 00:05:04,180
values I would have to put another block of string for space and then close up block of string and then

63
00:05:04,180 --> 00:05:04,950
plus sign.

64
00:05:04,960 --> 00:05:06,440
And then last name.

65
00:05:06,460 --> 00:05:12,640
So essentially I'm doing like string mathematics I'm just adding as many strings as I need to to join

66
00:05:12,640 --> 00:05:13,130
them.

67
00:05:13,240 --> 00:05:17,140
And then all of this will be printed out in one continuous line.

68
00:05:17,350 --> 00:05:23,280
So I'm want to get the static text my full name is with that space see that space between the colon

69
00:05:23,340 --> 00:05:25,030
and the end quotation mark.

70
00:05:25,030 --> 00:05:32,320
Then I add the first name and then I have to add another space and then I'm adding the last name the

71
00:05:32,320 --> 00:05:35,740
third way to concatenate after writing console.

72
00:05:35,750 --> 00:05:35,910
Right.

73
00:05:35,980 --> 00:05:39,700
Line is by doing what we call interpolation.

74
00:05:39,700 --> 00:05:47,890
So in this instance we actually start off our string with a dollar sign then we open quotation marks

75
00:05:48,160 --> 00:05:54,970
and then this allows us to use a curly brace and input our variable directly inside of the quotation

76
00:05:54,970 --> 00:05:55,590
marks.

77
00:05:55,600 --> 00:06:04,060
So then I can see my full name is space and then just inject the first name have a space and then inject

78
00:06:04,180 --> 00:06:05,030
last name.

79
00:06:05,170 --> 00:06:09,010
All of this still inside of the quotation marks.

80
00:06:09,060 --> 00:06:14,960
Now let's test all three of these and see that they work the same way there we go.

81
00:06:14,990 --> 00:06:16,340
Three different techniques.

82
00:06:16,340 --> 00:06:20,180
Same sentence my full name is Trevor or Williams.

83
00:06:20,180 --> 00:06:26,960
Notice the species are all there and once again it all depends on how you format your text in the static

84
00:06:27,200 --> 00:06:28,770
parts.

85
00:06:28,770 --> 00:06:31,610
Now let's move on to counting the length of four string.

86
00:06:31,610 --> 00:06:37,820
If I wanted to know how many letters were in my first name then I would need to find the cones off the

87
00:06:37,820 --> 00:06:44,750
contents so remember that I'm putting it in a variable and if we were allowing the user to enter content

88
00:06:44,750 --> 00:06:50,240
into this variable I would not know at any point what the value of first name is however I do want to

89
00:06:50,240 --> 00:06:50,740
know.

90
00:06:50,900 --> 00:06:55,820
I wanted to probably build a program that allowed people to just type in their name and then tell them

91
00:06:56,030 --> 00:06:58,330
your name is X characters long.

92
00:06:58,550 --> 00:07:05,150
So to find the length of a string I would need firstly an integer variable and I'm just gonna call this

93
00:07:05,240 --> 00:07:12,140
int length because I need somewhere to store the length value that I wouldn't just call the string variable

94
00:07:12,380 --> 00:07:13,140
by its name.

95
00:07:13,160 --> 00:07:20,780
So first name then I can see a dot and then I go to the function or property or other length.

96
00:07:20,840 --> 00:07:26,480
So the difference between our function on a property is that you may call functions using the power

97
00:07:26,480 --> 00:07:32,030
indices but then there are times when you have to use the dot operator and when we get into the explanation

98
00:07:32,030 --> 00:07:35,990
of object oriented programming then explain that dot operator a bit more.

99
00:07:35,990 --> 00:07:42,650
But once we see some variable some string variable and then we see a doctor and I just remove the links

100
00:07:42,920 --> 00:07:48,390
and then we control space we can see that we have a host of properties shown by the wrench and function

101
00:07:48,420 --> 00:07:49,760
shown by the cube.

102
00:07:49,760 --> 00:07:57,110
So if I see a dot length it is no getting back the length of whatever string or whatever value this

103
00:07:57,110 --> 00:07:58,680
string variable has.

104
00:07:58,730 --> 00:08:05,360
So I'm winter on this program and I believe my name is seven characters long so I'm going to put that

105
00:08:05,360 --> 00:08:07,340
theory to the test.

106
00:08:07,430 --> 00:08:13,610
I did that prematurely I did not put the console dot right line so console dot right line and we're

107
00:08:13,700 --> 00:08:17,480
writing the value of the variable length and there we go.

108
00:08:17,480 --> 00:08:22,290
So my name is indeed seven characters long.

109
00:08:22,320 --> 00:08:26,260
Please not that space is also code as values.

110
00:08:26,300 --> 00:08:32,870
So if I phoned the length of full name and I'll just duplicate these two lines and then do another print.

111
00:08:32,870 --> 00:08:42,120
But this time I'm going to say I want the length of full name and let me just ceiling one some printing

112
00:08:42,150 --> 00:08:50,720
bringing the value of length one this time and then I'm going to see what but at that use then my sentence

113
00:08:50,720 --> 00:08:58,400
that is in the variable full name is actually thirty one characters long because each I comma space

114
00:08:58,640 --> 00:09:04,340
that's four characters and then all of them add up so everything that is between the quotation marks

115
00:09:04,550 --> 00:09:12,140
will be counted in the calculation of the length C sharp makes it easy for us to replace the contents

116
00:09:12,140 --> 00:09:16,870
are parts of us true but I'm going to explain what I mean by that.

117
00:09:16,870 --> 00:09:24,250
So 1 once a string is cleared then you cannot just run the function and change the value of the string

118
00:09:24,260 --> 00:09:30,350
you have to put an operation like a replacement instead of another variable and then you may use that

119
00:09:30,470 --> 00:09:31,220
variable.

120
00:09:31,220 --> 00:09:39,110
So I'm going to have to declare a new variable string new name and then I'm going to make it equal to

121
00:09:39,520 --> 00:09:49,930
the first name not replace and then replace function takes two characters it takes the old char and

122
00:09:49,930 --> 00:09:59,310
the new charter old char meaning what letter R character or symbol whatever it is that is in the string

123
00:09:59,310 --> 00:10:01,030
that I want to remove.

124
00:10:01,030 --> 00:10:02,440
What did to what is it.

125
00:10:02,440 --> 00:10:05,580
So I want to replace the letter T.

126
00:10:05,710 --> 00:10:06,960
And then I see a comma.

127
00:10:07,030 --> 00:10:10,970
I notice that the char has a single quotation marks.

128
00:10:11,020 --> 00:10:16,840
So char is not double quotation marks like string but it's a single quotation marks.

129
00:10:16,960 --> 00:10:21,530
And then we are replacing the T with let's say a kid.

130
00:10:21,550 --> 00:10:26,980
I've never seen my name but like that or any variation of my name that starts with a K.

131
00:10:27,100 --> 00:10:34,990
But the new name is going to be first name not replace any t with the letter K and then let's just write

132
00:10:35,020 --> 00:10:41,960
that to the console and then see the output of that operation.

133
00:10:41,960 --> 00:10:42,370
All right.

134
00:10:42,370 --> 00:10:42,910
There we go.

135
00:10:42,910 --> 00:10:47,680
So it looked instead of my name on it phoned the T and replaced it with a key.

136
00:10:47,710 --> 00:10:53,950
Now let's try one with some more letters so let's say I wanted to replace all the i's in Williams with

137
00:10:54,040 --> 00:10:58,950
O's someone to just repeat this operation down below.

138
00:10:58,960 --> 00:11:02,800
And then this said I'm doing it on last name.

139
00:11:02,800 --> 00:11:12,610
So last name to replace and I'm replacing I with O and then I'm doing new name one and I'm printing

140
00:11:12,610 --> 00:11:15,660
you name one to the console and let's see what happens.

141
00:11:15,670 --> 00:11:16,060
All right.

142
00:11:16,060 --> 00:11:24,610
So every instance often I got replaced by the new char which is all like I said this can be with any

143
00:11:24,880 --> 00:11:32,500
character say if I wanted to replace the i's with an add sign or a hashtag or a number whatever it is

144
00:11:32,500 --> 00:11:36,790
as long as it can fit in between these quotation marks and it's just one output.

145
00:11:37,000 --> 00:11:43,310
If I put 12 let's see what happens if I put twelve then I'm getting an error seeing too many characters

146
00:11:43,340 --> 00:11:44,660
in character literal.

147
00:11:44,690 --> 00:11:47,420
So once again our character is only singular.

148
00:11:47,540 --> 00:11:53,320
All right so it's either going to be empty or half it's going to be even if it's empty.

149
00:11:53,330 --> 00:11:59,270
I wanted a space I have to put that space but I can't have it with no content or with more than one

150
00:12:00,430 --> 00:12:01,880
characters are.

151
00:12:01,910 --> 00:12:04,820
So I'll leave that out us all.

152
00:12:04,860 --> 00:12:07,870
Now let's move on to comparing strings from time to time.

153
00:12:07,880 --> 00:12:14,480
We probably will want to compare some thing that is entered maybe by user and it's stored in a variable

154
00:12:14,690 --> 00:12:18,290
with some string that we know and expect.

155
00:12:18,320 --> 00:12:24,020
So we want to do a computer or we want to compare two bits of input like maybe when somebody types in

156
00:12:24,020 --> 00:12:29,150
a password the first time and then day after retype it the second time you want to compare the two just

157
00:12:29,150 --> 00:12:32,110
to make sure that they type the same thing both times.

158
00:12:32,120 --> 00:12:34,310
No you can always use an if statement.

159
00:12:34,310 --> 00:12:38,940
We went through if statements or you can say if and I want to use two variables that they have you're

160
00:12:38,960 --> 00:12:44,090
already first name last name so what if I wanted to compare and see if the first name and last name

161
00:12:44,330 --> 00:12:46,160
had the same values.

162
00:12:46,160 --> 00:12:56,920
So I can always say if first name is equivalent to last name so that's an easy way to compare them.

163
00:12:56,950 --> 00:13:03,620
So of course we can see if they are equal and we see a console dot right line.

164
00:13:03,650 --> 00:13:12,070
You have the same name for first and last.

165
00:13:12,070 --> 00:13:12,400
All right.

166
00:13:12,940 --> 00:13:20,860
So telling them that okay you have the same name for first and last else and then I'm going to see you

167
00:13:20,860 --> 00:13:28,720
have a different name for first and last so there's always that option of the if else that's.

168
00:13:28,730 --> 00:13:30,640
That's perfectly fine.

169
00:13:30,640 --> 00:13:33,810
But then sometimes this might be kind of accurate.

170
00:13:33,820 --> 00:13:39,790
So then sometimes you want to say something like string and that's kept up a string and you can actually

171
00:13:39,790 --> 00:13:41,470
read come on a string.

172
00:13:41,470 --> 00:13:48,160
The the C Sharp will see them interchangeably and then you have an option that says compare so you can

173
00:13:48,160 --> 00:13:55,480
see a string dot compare and then you pass in the strings that you want to compare string a and string

174
00:13:55,480 --> 00:14:04,330
B so string a would be first name and that is the one that you want to compare with last name.

175
00:14:04,330 --> 00:14:10,270
So you see there are many ways to do the same operation but then this one is kind of OK.

176
00:14:10,290 --> 00:14:13,390
It's straightforward it's going to see if they are equivalent.

177
00:14:13,390 --> 00:14:15,350
Then do this as do that.

178
00:14:15,370 --> 00:14:18,400
This is going to return an integer.

179
00:14:18,490 --> 00:14:21,960
So I'll have to store it the return value inside of a variable.

180
00:14:21,960 --> 00:14:30,550
So I went to see it result is equal to string and compare first name common last name and then I'm going

181
00:14:30,550 --> 00:14:33,810
to have to do an if statement our own results.

182
00:14:33,850 --> 00:14:40,280
So you can have three potential results from this operation and it can either be equal to zero.

183
00:14:40,330 --> 00:14:44,260
It can be our one or negative one when it is zero.

184
00:14:44,260 --> 00:14:47,150
That means that the two strings are equal.

185
00:14:47,440 --> 00:14:47,770
All right.

186
00:14:47,770 --> 00:14:53,920
So when it's a zero when this operation string compare with two strings returns a zero.

187
00:14:53,920 --> 00:15:02,320
So I can see if result is equivalent to zero then it would evaluate the same thing as first name being

188
00:15:02,320 --> 00:15:03,760
equal to last name.

189
00:15:03,760 --> 00:15:07,470
Then I can print you have the same first name and last name.

190
00:15:07,480 --> 00:15:07,780
Right.

191
00:15:08,320 --> 00:15:11,100
And then I can see else also.

192
00:15:11,440 --> 00:15:16,760
Because then if it's a one or a negative one those simply mean that they're not equal.

193
00:15:16,900 --> 00:15:22,540
But then when it's one it means that the first string is probably bigger or has more characters on the

194
00:15:22,540 --> 00:15:23,950
second string.

195
00:15:23,950 --> 00:15:24,190
All right.

196
00:15:24,190 --> 00:15:29,620
So when it's I want it just means that OK the first string is longer than the second string.

197
00:15:29,620 --> 00:15:31,880
I wouldn't think it's one is the other way our own.

198
00:15:31,930 --> 00:15:38,710
But the essential thing to note is that if you do this approach then results should be equivalent to

199
00:15:38,710 --> 00:15:43,290
zero to certify that the two strings are the same.

200
00:15:43,300 --> 00:15:43,600
All right.

201
00:15:43,600 --> 00:15:47,740
So these are two ways that you can compare strings.

202
00:15:47,800 --> 00:15:52,290
You can use whichever one is appropriate you at the time no.

203
00:15:52,780 --> 00:15:58,570
Previously when you were looking at input and output programs you would see where when you're receiving

204
00:15:58,660 --> 00:16:05,690
a number or you intend to receive something to store into a numeric variable or some variable that is

205
00:16:05,700 --> 00:16:11,900
not already a string that you had to convert from the string to that data type.

206
00:16:11,920 --> 00:16:14,740
Well sometimes you will need to do the reverse.

207
00:16:14,800 --> 00:16:21,010
So you would have seen that in concatenation earlier that you can actually concatenate your string with

208
00:16:21,100 --> 00:16:23,490
almost any data type on it would accept it.

209
00:16:23,650 --> 00:16:26,970
But there are times when you need to convert to string.

210
00:16:27,160 --> 00:16:29,410
So converting to string is really easy though.

211
00:16:29,440 --> 00:16:35,650
So I have an integer variable here already so I'm just going to reuse this variable and naughty if you

212
00:16:35,650 --> 00:16:40,970
have a variable already and you want to change the value you don't have to specify the data type again.

213
00:16:41,090 --> 00:16:45,580
I can just see a result is equal to zero right here to force it to that are one two three four five

214
00:16:45,580 --> 00:16:47,030
six seven eight nine.

215
00:16:47,050 --> 00:16:47,880
All right.

216
00:16:47,910 --> 00:16:49,540
I notice s plus signs.

217
00:16:49,540 --> 00:16:51,330
So I'm going to have to remove those.

218
00:16:51,340 --> 00:16:51,820
Sorry.

219
00:16:52,390 --> 00:16:53,050
All right.

220
00:16:53,050 --> 00:17:00,370
No spaces so no I have a result which is an integer being equal to a value of one two three four five

221
00:17:00,700 --> 00:17:01,750
seven eight nine.

222
00:17:01,780 --> 00:17:04,180
That's one big integer result.

223
00:17:04,190 --> 00:17:11,950
Now if I wanted to sort this in a string I wanted to a string big number is equal to and then I wanted

224
00:17:11,950 --> 00:17:14,110
it to have the contents of result.

225
00:17:14,110 --> 00:17:21,250
Then I will get an arrow simply because it's going to say I cannot convert or implicitly convert an

226
00:17:21,310 --> 00:17:24,390
integer into a string which is fine.

227
00:17:24,400 --> 00:17:25,360
That's fair.

228
00:17:25,360 --> 00:17:29,380
So remember that integers are used for math pretty much.

229
00:17:29,380 --> 00:17:32,160
I wanted to string you won't be doing that kind of math.

230
00:17:32,950 --> 00:17:39,820
So if I wanted to convert my integer into maybe a string for whatever reason I can just look at the

231
00:17:39,820 --> 00:17:47,800
variable that I intend to convert and see Dot I then there's a magical function that's is so strong.

232
00:17:47,830 --> 00:17:54,970
So I just see results dot the string and then it will convert that into a string and then once it's

233
00:17:54,970 --> 00:17:55,670
a string.

234
00:17:55,780 --> 00:18:02,020
It is a less hassle to concatenate because there's not every student on that is going to be so forgiving

235
00:18:02,020 --> 00:18:06,390
that you can just plug it into a sentence and it won't throw an arrow.

236
00:18:06,400 --> 00:18:06,830
All right.

237
00:18:07,090 --> 00:18:12,080
So there are times when you will want to do a conversion.

238
00:18:12,130 --> 00:18:19,840
So I'm just going to print my bank account my bank balance is big number.

239
00:18:19,960 --> 00:18:22,900
All right so my bank balance is big number.

240
00:18:22,900 --> 00:18:28,510
And then that will just print out that sentence with this newly created string.

241
00:18:28,510 --> 00:18:35,170
Now once again once it's a string even though the content looks numeric I cannot go ahead and perform

242
00:18:35,170 --> 00:18:40,360
an operation that says int total maybe I got a one dollar payment today.

243
00:18:40,360 --> 00:18:48,040
So I want to add that one dollar so I to say one plus and then I can just say one plus big number

244
00:18:52,200 --> 00:18:52,520
all right.

245
00:18:52,530 --> 00:18:58,440
That would throw an error because I'm trying to do arithmetic here where I'm adding the number one to

246
00:18:58,590 --> 00:19:00,150
something that isn't all a string.

247
00:19:00,150 --> 00:19:07,400
I cannot do that so I will have to of course just keep it into integer in nature.

248
00:19:07,530 --> 00:19:13,510
And then if I need toto to be a string afterwards then I can convert my seem to string.

249
00:19:13,510 --> 00:19:16,570
No I mean this example with numbers.

250
00:19:16,620 --> 00:19:21,620
But then this is not you need two numbers you can convert char to string you can convert double its

251
00:19:21,620 --> 00:19:24,880
a string you can convert almost anything to string.

252
00:19:25,050 --> 00:19:28,200
There are restrictions on maybe arrays and other collection types.

253
00:19:28,200 --> 00:19:34,080
But the fact is once you see this operation or if you want to know if you have that operation available

254
00:19:34,080 --> 00:19:39,720
to you you can just type your variable out and then use your dot operator and then you can just see

255
00:19:39,720 --> 00:19:43,050
if it is listed there for you in intelligence.

256
00:19:43,050 --> 00:19:43,500
All right.

257
00:19:43,560 --> 00:19:47,610
So I'm just going to run this program and then we're going to look at all of our examples printing to

258
00:19:47,610 --> 00:19:49,420
screen.

259
00:19:49,440 --> 00:19:55,330
All right so just a quick run through we've printed our first sentence which was phoned in the full

260
00:19:55,330 --> 00:20:00,290
name The invariable we looked at the three different types of concatenation one with the place holders

261
00:20:00,300 --> 00:20:02,790
one with plus signs and one with interpolation.

262
00:20:02,850 --> 00:20:08,510
We phoned the length of our first name variable value as well as the length of a sentence.

263
00:20:08,550 --> 00:20:13,920
We did a string replace on all Ts in my name and all I's in my surname.

264
00:20:13,920 --> 00:20:19,380
And then we did a string comparison where both results would have had the fact that it's a different

265
00:20:19,380 --> 00:20:20,820
name for first and last.

266
00:20:20,820 --> 00:20:24,500
After comparing the first name value with the last name value.

267
00:20:24,570 --> 00:20:30,730
And then we did a string conversion for our variable for integer variable that represents our account

268
00:20:30,840 --> 00:20:32,210
balance.

269
00:20:32,210 --> 00:20:38,190
In closing this list I'm just going to see that this is just the touch off the surface C sharp string

270
00:20:38,190 --> 00:20:45,060
manipulation capabilities are very extensive and it would require a much longer explanation and video

271
00:20:45,060 --> 00:20:48,560
to actually go through every single thing that it is capable of.

272
00:20:48,750 --> 00:20:55,800
But that being said I encourage you to experiment and just type all its creates a string variable and

273
00:20:55,800 --> 00:21:00,260
then just use a dot operator to see all of the other functions that are available to you.

274
00:21:00,360 --> 00:21:07,050
So you can just have your dot your variable sorry first name and then you see a dot and then everything

275
00:21:07,050 --> 00:21:13,640
that is here you see the visual studio sorry has an explanation as to what it is for.

276
00:21:13,650 --> 00:21:16,650
All right so I encourage you to just go ahead and experiment.

277
00:21:16,650 --> 00:21:23,180
Just type a sentence and or on each one of these and print to the console and see what the outcome is.
