Skip to content

Instantly share code, notes, and snippets.

@yzorg
Created October 18, 2018 18:27
Show Gist options
  • Save yzorg/9eb971fef42ec4b5294a2e97b3c9f63a to your computer and use it in GitHub Desktop.
Save yzorg/9eb971fef42ec4b5294a2e97b3c9f63a to your computer and use it in GitHub Desktop.
// 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);
}
}
@yzorg
Copy link
Author

yzorg commented Oct 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment