Created
October 18, 2018 18:27
-
-
Save yzorg/9eb971fef42ec4b5294a2e97b3c9f63a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample code comes from Humanizer Git Home | |
// https://github.com/MehdiK/Humanizer | |
using System; | |
using Humanizer; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
WriteInOut("\"Underscored_input_String_is_turned_INTO_sentence\".Humanize()", "Underscored_input_String_is_turned_INTO_sentence".Humanize()); | |
// PascalCase transform: TestService | |
WriteInOut("\"TEST_SERVICE\".ToLowerInvariant().Humanize().Transform(To.TitleCase).Replace(\" \", \"\")", "TEST_SERVICE".ToLowerInvariant().Humanize().Transform(To.TitleCase).Replace(" ", "")); | |
return; | |
} | |
public static void WriteInOut(string call, string callOutput) | |
{ | |
string line = call.PadLeft(70, ' ') + " => " + callOutput; | |
Console.WriteLine(line); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
forked from https://dotnetfiddle.net/sKea7c