DNTPersianUtils.Core
6.2.0
dotnet add package DNTPersianUtils.Core --version 6.2.0
NuGet\Install-Package DNTPersianUtils.Core -Version 6.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DNTPersianUtils.Core" Version="6.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DNTPersianUtils.Core --version 6.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DNTPersianUtils.Core, 6.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DNTPersianUtils.Core as a Cake Addin
#addin nuget:?package=DNTPersianUtils.Core&version=6.2.0
// Install DNTPersianUtils.Core as a Cake Tool
#tool nuget:?package=DNTPersianUtils.Core&version=6.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DNTPersianUtils.Core
<div dir="rtl"> DNTPersianUtils.Core کتابخانهای است متشکل از متدهای الحاقی کمکی جهت کار با فرهنگ فارسی، در برنامههای مبتنی بر NET Core. و همچنین NET 4.x. برای نصب آن دستور ذیل را در کنسول پاورشل نیوگت اجرا کنید: </div>
PM> Install-Package DNTPersianUtils.Core
لیست متدها و امکانات این کتابخانه
نام متد/امکانات | مثال | خروجی نمونه |
---|---|---|
نمایش فارسی روز دریافتی | dt.ToPersianDateTextify() | سه شنبه ۲۱ دی ۱۳۹۵ |
نمایش دوستانهی یک تاریخ و ساعت انگلیسی به شمسی | dt.ToFriendlyPersianDateTextify() | ۱۰ روز قبل، سه شنبه ۲۱ دی ۱۳۹۵، ساعت ۱۰:۲۰ |
تبدیلگر عدد به حروف | 1234567.NumberToText(Language.Persian) | یک میلیون و دویست و سی و چهار هزار و پانصد و شصت و هفت |
نگارش اصلاح شدهی فرهنگ فارسی | PersianCulture.Instance <br> Thread.CurrentThread.CurrentCulture = PersianCulture.Instance; | در این فرهنگ تاریخ میلادی با شمسی جایگزین شدهاست |
تبدیل تاریخ و زمان رشتهای شمسی به میلادی | "1395/11/3 7:30".ToGregorianDateTime() | new DateTime(2017, 1, 22, 7, 30, 0) |
تبدیل تاریخ میلادی به شمسی | dt.ToLongPersianDateString() | 21 دی 1395 |
تبدیل تاریخ میلادی به شمسی | dt.ToLongPersianDateTimeString() | 21 دی 1395، 10:20:02 ق.ظ |
تبدیل تاریخ میلادی به شمسی | dt.ToPersianDateTimeString("dd MMMM yyyy") | این تبدیل بر اساس فرهنگ اصلاح شدهی فارسی صورت میگیرد. مانند <br> dt.ToPersianDateTimeString("dd MMMM yyyy - HH:mm") <br> با این خروجی فرضی: «21 دی 1395 - 10:20» |
تبدیل تاریخ میلادی به شمسی | dt.ToShortPersianDateString() | 1395/10/21 |
تبدیل تاریخ میلادی به شمسی | dt.ToShortPersianDateTimeString() | 1395/10/21 10:20 |
تاریخ روزهای ابتدا و انتهای سال شمسی | dt.GetPersianYearStartAndEndDates() | مثال |
تاریخ روزهای ابتدا و انتهای ماه شمسی | dt.GetPersianMonthStartAndEndDates() | مثال |
تاریخ روزهای ابتدا و انتهای هفته شمسی | dt.GetPersianWeekStartAndEndDates() | مثال |
تبدیل عدد انگلیسی به فارسی | 123.ToPersianNumbers() | ۱۲۳ |
آیا عبارت مدنظر حاوی حروف فارسی است؟ | "Abc تست".ContainsFarsi() | true |
اصلاح ي و ك عربی به فارسی | "سنجاقك آبي".ApplyCorrectYeKe() | سنجاقک آبی |
راست به چپ کردن یک متن ساده مخلوط برای نمایش در محیطهای چپ به راست مانند فید خوانها | "سلام Abc".ApplyRle() | Abc سلام |
محاسبه سن | DateTime.Now.AddYears(-9).GetAge() | 9 |
آیا تاریخ و زمان مدنظر آغاز سال نوی شمسی است؟ | dt.IsStartOfNewYear() | true/false |
مجموعه کلمات بیاثر زبان فارسی | PersianStopwords.List | مفید برای تنظیمات جستجوهای تمام متنی |
نرمال کردن متون. پارامتر آن قابلیت ترکیب را دارد. | "'تست'".NormalizePersianText(<br>PersianNormalizers.ConvertEnglishQuotes) | «تست» |
لیست مناطق و استانها | Iran.Provinces | Iran.Provinces لیست تو در توی استانها و شهرهای ایران |
مناسبتهای تعطیلات رسمی ایران | Iran.Holidays | مناسبتهای تعطیلات رسمی ایران از سال 1395 تا پایان سال 1402 |
دریافت لیست روزهای کاری یک بازه زمانی | IranHolidays.GetBusinessDays() | روزهای کاری ایران از سال 1395 تا پایان سال 1402 |
تبدیل تاریخ میلادی به قمری | new DateTime(2018, 08, 31).ToIslamicDay() | new IslamicDay(1439, 12, 19) |
تبدیل تاریخ شمسی به قمری | IslamicDateUtils.PersianDayToIslamicDay(1397, 6, 9) | new IslamicDay(1439, 12, 19) |
تبدیل ايران سيستم به يونيكد | "(‘®õø¢‘“) üî¤ðþ› é÷¬".FromIranSystemToUnicode() | "صنف جیگرکی (بادوامضاء)" |
تبدیل يونيكد به ايران سيستم | "صنف جیگرکی (بادوامضاء)".FromUnicodeToIranSystem() | "(‘®õø¢‘“) üî¤ðþ› é÷¬" |
اعتبارسنجها
نام متد/امکانات | مثال | خروجی نمونه |
---|---|---|
تعیین اعتبار تاریخ و زمان رشتهای شمسی | "1395/12/30".IsValidPersianDateTime()<br>به همراه [ValidPersianDateTime] مخصوص MVC | true |
بررسی اعتبار کد ملی | "0010350829".IsValidIranianNationalCode() <br>به همراه [ValidIranianNationalCode] مخصوص MVC | true |
بررسی اعتبار کد بانکی شبا | "IR820540102680020817909002".<br>IsValidIranShebaNumber() <br>به همراه [ValidIranShebaNumber] مخصوص MVC | true |
بررسی اعتبار کد بانکی شتاب | "6221061106498670".<br>IsValidIranShetabNumber() <br>به همراه [ValidIranShetabNumber] مخصوص MVC | true |
بررسی اعتبار شماره موبایل | "09901464762".<br>IsValidIranianMobileNumber() <br>به همراه [ValidIranianMobileNumber] مخصوص MVC | true |
بررسی اعتبار شماره تلفن | "37236445".<br>IsValidIranianPhoneNumber() <br>به همراه [ValidIranianPhoneNumber] مخصوص MVC | true |
بررسی اعتبار کد پستی | "1619735744".<br>IsValidIranianPostalCode() <br>به همراه [ValidIranianPostalCode] مخصوص MVC | true |
بررسی اعتبار اعداد تمام فارسی | "۹۹۹۹۹".<br>ContainsOnlyPersianNumbers() <br>به همراه [ShouldContainOnlyPersianNumbers] مخصوص MVC | true |
بررسی اعتبار حروف و یا اعداد فارسی بودن تنها قسمتی از متن | "Abc تست".<br>ContainsFarsi() <br>به همراه [ShouldContainPersianLettersOrNumbers] مخصوص MVC | true |
بررسی اعتبار حروف فارسی بودن تمام متن | "تست".<br>ContainsOnlyFarsiLetters() <br>به همراه [ShouldContainOnlyPersianLetters] مخصوص MVC | true |
بررسی اعتبار شناسه ملی حقوقی | "14005893875".IsValidIranianNationalLegalCode() <br>به همراه [ValidIranianNationalLegalCodeAttribute] مخصوص MVC | true |
نحوه کار با اطلاعات استانها
foreach (var province in Iran.Provinces)
{
foreach (var county in province.Counties)
{
foreach (var district in county.Districts)
{
foreach (var city in district.Cities)
{
}
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.3 is compatible. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6
- No dependencies.
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Globalization.Extensions (>= 4.3.0)
- System.Reflection (>= 4.3.0)
- System.Reflection.TypeExtensions (>= 4.7.0)
- System.Text.Encoding.CodePages (>= 5.0.0)
-
.NETStandard 2.0
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
-
.NETStandard 2.1
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Text.Encoding.CodePages (>= 8.0.0)
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (18)
Showing the top 5 NuGet packages that depend on DNTPersianUtils.Core:
Package | Downloads |
---|---|
ATA.Bit.Helper
Make developing Bit app in ATA co. easy and fast |
|
DNTCommon.Web.Core
DNTCommon.Web.Core provides common scenarios' solutions for ASP.NET Core applications. |
|
KAM.Kourosh.SharedLibraries
SharedModels for Kourosh |
|
Pejbar.Utility
Package Description |
|
wallet.lib.common
Add HttpPut to ApiClient |
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on DNTPersianUtils.Core:
Repository | Stars |
---|---|
rabbal/DNTFrameworkCore
Lightweight and Extensible Infrastructure for Building Web Applications - Web Application Framework
|
|
VahidN/DNTIdentity
A highly customized sample of the ASP.NET Core Identity
|
|
VahidN/DNTCommon.Web.Core
DNTCommon.Web.Core provides common scenarios' solutions for ASP.NET Core applications.
|
Version | Downloads | Last updated |
---|---|---|
6.2.0 | 735 | 4/13/2024 |
6.1.0 | 362 | 4/9/2024 |
6.0.1 | 108 | 4/8/2024 |
6.0.0 | 125 | 4/7/2024 |
5.9.1 | 569 | 3/20/2024 |
5.9.0 | 2,018 | 1/31/2024 |
5.8.1 | 3,572 | 11/16/2023 |
5.8.0 | 356 | 11/12/2023 |
5.7.1 | 10,579 | 8/8/2023 |
5.7.0 | 948 | 7/28/2023 |
5.6.1 | 5,828 | 4/27/2023 |
5.6.0 | 376 | 4/25/2023 |
5.5.5 | 1,168 | 4/24/2023 |
5.5.4 | 168 | 4/24/2023 |
5.5.3 | 1,105 | 4/24/2023 |
5.5.2 | 578 | 4/18/2023 |
5.5.1 | 187 | 4/17/2023 |
5.5.0 | 2,762 | 3/1/2023 |
5.4.9 | 5,900 | 11/30/2022 |
5.4.8 | 325 | 11/29/2022 |
5.4.7 | 326 | 11/29/2022 |
5.4.6 | 672 | 11/21/2022 |
5.4.5 | 11,193 | 7/9/2022 |
5.4.4 | 9,606 | 5/15/2022 |
5.4.3 | 1,145 | 5/2/2022 |
5.4.2 | 494 | 4/30/2022 |
5.4.1 | 6,904 | 3/11/2022 |
5.4.0 | 43,681 | 11/28/2021 |
5.3.2 | 1,287 | 11/16/2021 |
5.3.1 | 2,876 | 9/20/2021 |
5.3.0 | 2,938 | 8/4/2021 |
5.2.0 | 5,165 | 7/31/2021 |
5.1.0 | 606 | 7/22/2021 |
5.0.0 | 1,284 | 7/17/2021 |
4.9.0 | 453 | 7/16/2021 |
4.8.0 | 1,191 | 7/10/2021 |
4.7.0 | 434 | 7/9/2021 |
4.6.0 | 486 | 7/7/2021 |
4.5.0 | 563 | 6/28/2021 |
4.4.0 | 571 | 6/24/2021 |
4.3.0 | 31,025 | 4/19/2021 |
4.2.1 | 549 | 4/13/2021 |
4.2.0 | 623 | 4/9/2021 |
4.1.0 | 535 | 4/5/2021 |
4.0.0 | 8,135 | 3/23/2021 |
3.9.0 | 56,171 | 1/8/2021 |
3.8.0 | 3,380 | 12/12/2020 |
3.7.0 | 881 | 11/28/2020 |
3.6.9 | 626 | 11/22/2020 |
3.6.8 | 7,479 | 8/5/2020 |
3.6.7 | 997 | 7/25/2020 |
3.6.6 | 969 | 7/15/2020 |
3.6.5 | 5,996 | 3/10/2020 |
3.6.4 | 516 | 3/10/2020 |
3.6.3 | 1,387 | 2/18/2020 |
3.6.2 | 7,343 | 12/12/2019 |
3.6.1 | 5,314 | 9/28/2019 |
3.6.0 | 1,185 | 9/23/2019 |
3.5.0 | 6,225 | 8/4/2019 |
3.4.0 | 689 | 8/3/2019 |
3.3.0 | 9,793 | 6/2/2019 |
3.2.1 | 13,203 | 5/19/2019 |
3.2.0 | 18,165 | 1/22/2019 |
3.1.0 | 6,216 | 11/11/2018 |
3.0.0 | 1,586 | 9/23/2018 |
2.9.0 | 6,397 | 8/31/2018 |
2.8.1 | 856 | 8/26/2018 |
2.8.0 | 824 | 8/24/2018 |
2.7.0 | 1,011 | 8/15/2018 |
2.6.1 | 856 | 8/14/2018 |
2.6.0 | 863 | 8/13/2018 |
2.5.0 | 1,328 | 7/24/2018 |
2.4.0 | 4,834 | 5/10/2018 |
2.3.0 | 2,711 | 3/10/2018 |
2.2.1 | 3,130 | 8/15/2017 |
2.2.0 | 2,238 | 4/22/2017 |
2.1.0 | 973 | 4/22/2017 |
2.0.1 | 1,244 | 4/16/2017 |
2.0.0 | 959 | 4/16/2017 |
1.9.2 | 1,052 | 4/10/2017 |
1.9.1 | 1,338 | 3/16/2017 |
1.9.0 | 1,134 | 2/26/2017 |
1.8.0 | 984 | 2/25/2017 |
1.7.0 | 998 | 2/20/2017 |
1.6.0 | 1,017 | 2/13/2017 |
1.5.0 | 1,008 | 2/5/2017 |
1.4.0 | 1,102 | 1/26/2017 |
1.3.0 | 1,033 | 1/23/2017 |
1.2.0 | 972 | 1/23/2017 |
1.1.0 | 996 | 1/23/2017 |
1.0.0 | 1,115 | 1/22/2017 |