20220723
This commit is contained in:
parent
87128879a5
commit
1a45750f27
@ -1,45 +1,33 @@
|
||||
namespace anbs_cp;
|
||||
|
||||
/// <summary>
|
||||
/// Класс, добавляющий реализацию некоторых методов Delphi, которые упрощают работу в C#.
|
||||
/// Класс, добавляющий реализацию некоторых методов Delphi, которые упрощают работу в C#.
|
||||
/// </summary>
|
||||
public static class LikeDelphi
|
||||
{
|
||||
/// <summary>
|
||||
/// Аналог функции IncludeTrailingBackslash
|
||||
/// Аналог функции IncludeTrailingBackslash
|
||||
/// </summary>
|
||||
/// <param name="path">Путь, к которому нужно добавить slash</param>
|
||||
/// <returns>Путь со slash в конце</returns>
|
||||
public static string IncludeTrailingBackslash(string path)
|
||||
public static string IncludeTrailingBackslash (string path)
|
||||
{
|
||||
//По умолчанию сохраняем путь
|
||||
string result = path;
|
||||
int Index = path.Length - 1;
|
||||
if (path[Index] != '\\') result = $"{path}\\";
|
||||
|
||||
//Если последний символ не "\", то добавим "\" в конце
|
||||
if (path[^1] != '\\')
|
||||
result = $@"{path}\";
|
||||
|
||||
//Вернём результат
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Парсер строки в множество строк
|
||||
/// Парсер строки в множество строк
|
||||
/// </summary>
|
||||
/// <param name="astring">Строка, которую нужно разбить</param>
|
||||
/// <param name="delim">Символ-делитель строки</param>
|
||||
/// <param name="str">Строка, которую нужно разбить</param>
|
||||
/// <param name="delimiter">Символ-делитель строки</param>
|
||||
/// <returns>Массив строк</returns>
|
||||
public static List<string> ParseString(string astring, char delim)
|
||||
{
|
||||
int from = -1;
|
||||
int to;
|
||||
List<string> result = new();
|
||||
do
|
||||
{
|
||||
from++;
|
||||
to = astring.IndexOf(delim, from);
|
||||
if (to <= 0)
|
||||
to = astring.Length;
|
||||
if (from != to)
|
||||
result.Add(astring[from..(to - from)]);
|
||||
from = to;
|
||||
} while (to != astring.Length);
|
||||
|
||||
return result;
|
||||
}
|
||||
public static List<string> ParseString (string str, char delimiter) => str.Split (delimiter).ToList();
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>1.2022.225</Version>
|
||||
<Version>1.2022.723</Version>
|
||||
<Authors>Alexander Babaev</Authors>
|
||||
<Product>ANB Software Components Pack</Product>
|
||||
<Description>Library of some useful functions in C# language.</Description>
|
||||
@ -15,8 +15,8 @@
|
||||
<SignAssembly>False</SignAssembly>
|
||||
<PackageProjectUrl>https://github.com/GoodBoyAlex/anbsoftware_componentspack</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/GoodBoyAlex/anbsoftware_componentspack</RepositoryUrl>
|
||||
<AssemblyVersion>1.2022.0225</AssemblyVersion>
|
||||
<FileVersion>1.2022.225</FileVersion>
|
||||
<AssemblyVersion>1.2022.723</AssemblyVersion>
|
||||
<FileVersion>1.2022.723</FileVersion>
|
||||
<PackageId>ANBSoftware.ComponentsPack</PackageId>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<AnalysisLevel>6.0</AnalysisLevel>
|
||||
|
4
anbsoftware.componentspack.sln.DotSettings
Normal file
4
anbsoftware.componentspack.sln.DotSettings
Normal file
@ -0,0 +1,4 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=anbs/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0412_0435_0440_043D_0451_043C/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_041F_0430_0440_0441_0435_0440/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
Loading…
x
Reference in New Issue
Block a user