mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-12-08 00:45:29 +01:00
feat(solutions): add camel-case/cs/function
This commit is contained in:
parent
3f5c0fe276
commit
ef084b6bfe
3
challenges/camel-case/solutions/cs/function/README.md
Normal file
3
challenges/camel-case/solutions/cs/function/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# camel-case/cs/function
|
||||||
|
|
||||||
|
Created by [@Divlo](https://github.com/Divlo) on 8 September 2021.
|
19
challenges/camel-case/solutions/cs/function/Solution.cs
Normal file
19
challenges/camel-case/solutions/cs/function/Solution.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Solution
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
string[] words = Console.ReadLine().ToLower().Trim().Split(" ");
|
||||||
|
string result = words[0];
|
||||||
|
for (int index = 1; index < words.Length; index++)
|
||||||
|
{
|
||||||
|
var word = words[index];
|
||||||
|
result += word[0].ToString().ToUpper() + word.Substring(1);
|
||||||
|
}
|
||||||
|
Console.WriteLine(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user