12 lines
No EOL
314 B
C#
12 lines
No EOL
314 B
C#
using System.Linq;
|
|
|
|
namespace PhoenixLib.Configuration
|
|
{
|
|
public static class StringExtensions
|
|
{
|
|
public static string ToUnderscoreCase(this string str)
|
|
{
|
|
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x : x.ToString())).ToLower();
|
|
}
|
|
}
|
|
} |