2021-03-26 20:09:52 +04:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
2022-03-18 22:38:52 +04:00
|
|
|
|
namespace ToolsModule.Extensions
|
2021-03-26 20:09:52 +04:00
|
|
|
|
{
|
|
|
|
|
public static class StringExtension
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Проверка, что строка пустая
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="str"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static bool IsEmpty(this string str) => string.IsNullOrEmpty(str);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Проверка, что строка не пустая
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="str"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static bool IsNotEmpty(this string str) => !string.IsNullOrEmpty(str);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение имени файла по полному пути
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="str"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static string GetFileName(this string str) => (new FileInfo(str)).Name;
|
|
|
|
|
}
|
|
|
|
|
}
|