Remove unnecessary System, System.Collections.Generic, System.IO, and System.Linq using directives that were flagged by IDE analyzers. Also includes minor whitespace and code style normalization. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
31 lines
788 B
C#
31 lines
788 B
C#
using System.Diagnostics;
|
|
|
|
namespace PepLib
|
|
{
|
|
public static class Util
|
|
{
|
|
public static string GetNestFileFormat(string filename)
|
|
{
|
|
try
|
|
{
|
|
var name = Path.GetFileName(filename);
|
|
var ext = Path.GetExtension(name);
|
|
|
|
if (name.LastIndexOf(ext) > 5 && !name.Contains("-"))
|
|
name = name.Insert(5, "-");
|
|
|
|
if (name.LastIndexOf(ext) > 8 && char.IsLetter(name[8]))
|
|
name = name.Remove(8, 1);
|
|
|
|
return Path.Combine(Path.GetDirectoryName(filename), name);
|
|
}
|
|
catch (SystemException ex)
|
|
{
|
|
Debug.WriteLine(ex.Message);
|
|
}
|
|
|
|
return string.Empty;
|
|
}
|
|
}
|
|
}
|