137
C#.net
{ action block 2 }
else
{ action block 3 }
is is the same as the following standard nested if- then statement:
if (condition 1)
{ action block 1 }
else
{ if (condition 2)
{ action block 2 }
else
{ action block 3 }
}
As shown in lines 66–79 of Listing5.11, the first character of a string is indexed
at the position 0, and it is of the char data type, not of the string data type. C#
treats the char data type and the string data type differently. e ToString()
method of any character will convert the character into the string data type so that
it can concatenate with other strings. e SubString(x) method of any string will
extract a substring from the original string, starting at the position x. For example,
SubString(1) will result in a new str ...