Code commit

This commit is contained in:
RisaDev
2024-01-06 01:21:41 +03:00
parent a7d7297c59
commit a486dd2c96
90 changed files with 11576 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
namespace CustomizePlus.Core.Helpers;
//todo: better name
internal static class NameParsingHelper
{
internal static (string Name, string? Path) ParseName(string name, bool handlePath)
{
var actualName = name;
string? path = null;
if (handlePath)
{
var slashPos = name.LastIndexOf('/');
if (slashPos >= 0)
{
path = name[..slashPos];
actualName = slashPos >= name.Length - 1 ? "<Unnamed>" : name[(slashPos + 1)..];
}
}
return (actualName, path);
}
}