File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
samples/snippets/csharp/VS_Snippets_CLR_System/system.String.Compare5/cs Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ public static void Main()
9
9
string name1 = "Jack Smith" ;
10
10
string name2 = "John Doe" ;
11
11
12
- // Get position of space character.
12
+ // Get position of character after the space character.
13
13
int index1 = name1 . IndexOf ( " " ) ;
14
- index1 = index1 < 0 ? 0 : index1 -- ;
14
+ index1 = index1 < 0 ? 0 : ++ index1 ;
15
15
16
16
int index2 = name2 . IndexOf ( " " ) ;
17
- index1 = index1 < 0 ? 0 : index1 -- ;
17
+ index2 = index2 < 0 ? 0 : ++ index2 ;
18
18
19
19
int length = Math . Max ( name1 . Length , name2 . Length ) ;
20
20
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+
3
+ <PropertyGroup >
4
+ <OutputType >Exe</OutputType >
5
+ <TargetFramework >netcoreapp3.0</TargetFramework >
6
+ <LangVersion >8.0</LangVersion >
7
+ <AllowUnsafeBlocks >True</AllowUnsafeBlocks >
8
+ </PropertyGroup >
9
+
10
+ </Project >
You can’t perform that action at this time.
0 commit comments