-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringComparisonOperation.cs
More file actions
48 lines (36 loc) · 1.1 KB
/
StringComparisonOperation.cs
File metadata and controls
48 lines (36 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
namespace PerformanceDemo
{
public class StringComparisonOperation
{
public bool EqualityComparison(string s1, string s2)
{
var results = s1 == s2;
return results;
}
public bool EqualsComparison(string s1, string s2)
{
var results = s1.Equals(s2);
return results;
}
public int StringCompareComparison(string s1, string s2)
{
var results = string.Compare(s1, s2);
return results;
}
public bool EqualityComparisonWithCase(string s1, string s2)
{
var results = s1.ToUpper() == s2.ToUpper();
return results;
}
public bool EqualsComparisonWithCase(string s1, string s2)
{
var results = s1.ToUpper().Equals(s2.ToUpper());
return results;
}
public int StringCompareComparisonWithCase(string s1, string s2)
{
var results = string.Compare(s1, s2,true);
return results;
}
}
}