mycroforge/MycroForge.CLI/Extensions/StringExtensions.cs

18 lines
499 B
C#

using Humanizer;
namespace MycroForge.CLI.Extensions;
public static class StringExtensions
{
public static string NormalizePath(this string name)
{
var directoryPath = Path.GetDirectoryName(name).Underscore();
var filePath = Path.Join(directoryPath, name.Underscore().ToLower());
return filePath;
}
public static string[] FullyQualifiedName(this string name)
{
return name.Split(':').Select(s => s.Trim()).ToArray();
}
}