PKHeX/PKHeX.Core/Util/PathUtil.cs
2017-05-12 09:33:12 -07:00

19 lines
507 B
C#

using System.IO;
using System.Linq;
namespace PKHeX.Core
{
public partial class Util
{
public static string CleanFileName(string fileName)
{
return Path.GetInvalidFileNameChars().Aggregate(fileName, (current, c) => current.Replace(c.ToString(), string.Empty));
}
public static string TrimFromZero(string input)
{
int index = input.IndexOf('\0');
return index < 0 ? input : input.Substring(0, index);
}
}
}