Skip to content

Commit

Permalink
add C#/thititongumpun (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
thititongumpun authored Oct 5, 2023
1 parent 86afa6f commit 746d547
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
28 changes: 28 additions & 0 deletions C#/thititongumpun/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Globalization;

class Program
{
private static void Main(string[] args)
{
{
string input = "";

while (input.ToLower() != "coffee")
{
Console.WriteLine("Please input Coffee or COFFEE: ");
input = Console.ReadLine()!;
if (input.ToLower() == "coffee")
{
Console.WriteLine(ToTitleCase("code"));
}
}
Environment.Exit(0);
}
}

private static string ToTitleCase(string str)
{
var textInfo = new CultureInfo("en-US", false).TextInfo;
return textInfo.ToTitleCase(str);
}
}
10 changes: 10 additions & 0 deletions C#/thititongumpun/thititongumpun.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

0 comments on commit 746d547

Please sign in to comment.