[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
Add non-locale case conversion and minor improvement for C#
Browse files Browse the repository at this point in the history
  • Loading branch information
osman-turan committed Mar 16, 2021
1 parent 61892e1 commit b5bf48f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 33 deletions.
4 changes: 2 additions & 2 deletions csharp/optimized/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void Main(string[] args)
string line;
while ((line = Console.ReadLine()) != null)
{
line = line.ToLower();
line = line.ToLowerInvariant();
var words = line.Split(' ', StringSplitOptions.RemoveEmptyEntries);
string word;
for (int i = 0; i < words.Length; i++)
Expand All @@ -29,7 +29,7 @@ static void Main(string[] args)
if (!counts.TryGetValue(word, out var count)) {
counts.Add(word, new Ref<int>(1));
} else {
count.Value += 1;
++count.Value;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion csharp/simple/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static void Main(string[] args)
string line;
while ((line = Console.ReadLine()) != null)
{
line = line.ToLower();
line = line.ToLowerInvariant();
var words = line.Split(' ', StringSplitOptions.RemoveEmptyEntries);
foreach (string word in words)
{
Expand Down
30 changes: 0 additions & 30 deletions simple.cs

This file was deleted.

0 comments on commit b5bf48f

Please sign in to comment.