IvanStoychev.StringExtensions 2.0.0-RC-14Jun2021

A .Net Core library of useful extension methods for the "string" class in C#.

Suggested Alternatives

IvanStoychev.Useful.String.Extensions

Additional Details

Thank you for using my package!

Unfortunately, the package's name had to be changed and will be published from now on as "Ivan Stoychev's String Extensions" with ID "IvanStoychev.Useful.String.Extensions". That package has much more useful features and functionality.

This is a prerelease version of IvanStoychev.StringExtensions.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
Install-Package IvanStoychev.StringExtensions -Version 2.0.0-RC-14Jun2021
dotnet add package IvanStoychev.StringExtensions --version 2.0.0-RC-14Jun2021
<PackageReference Include="IvanStoychev.StringExtensions" Version="2.0.0-RC-14Jun2021" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IvanStoychev.StringExtensions --version 2.0.0-RC-14Jun2021
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: IvanStoychev.StringExtensions, 2.0.0-RC-14Jun2021"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install IvanStoychev.StringExtensions as a Cake Addin
#addin nuget:?package=IvanStoychev.StringExtensions&version=2.0.0-RC-14Jun2021&prerelease

// Install IvanStoychev.StringExtensions as a Cake Tool
#tool nuget:?package=IvanStoychev.StringExtensions&version=2.0.0-RC-14Jun2021&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

+ Added "SubstringStart" method that selects everything from the start of the string to the first occurrence of a given substring.
+ Added "SubstringEnd" method that selects everything from the first occurrence of a given substring to the end of the original string.
+ Added "SubstringEndLast" method that selects everything from the last occurrence of a given substring to the end of the original string.
+ Added "SubstringStartLast" method that returns a substring from the start of the original instance to the last occurrence of the given "endString" argument.
+ Added better exception throwing for the "Selector" methods. Now if an exception is thrown by one of those methods it will be much more informative for the user.
+ Improved the function of all "substring" methods. Before they were looking for the indexes of their various "substring" parameters twice, that has been fixed and now they should be approx. twice faster.

= Trimmed overloads of all methods. Now there are only one or two overloads for a single method that achieve the same functionality as all the old overloads by use of optional parameters.
This change was made for two reasons:
1. The old strategy was to have multiple overloads, each with more parameters than the previous, thus providing more flexibility to the user. Since overloads with fewer parameters simply called overloads with one more parameter, passing a default value, this strategy has been deprecated in favour of having less (ideally only one) method/overload having the minimal amount of required parameters and the rest being optional. In this way the same functionality as before is achieved but the code is more maintainable and easier to read.
2. Being able to see what the default values for the optional parameters are will give the user more information about how the code is going to process his request. For example: by calling "Substring("test")" the user would not know how the string comparison is going to be performed. But seeing the default argument used for it will show him just that.

⚠ Changed the way the "Substring" method, which accepts a "length" argument, works. This is the method which returns a substring of length "length", starting from the first index at which a given "startString" occurs.
Before if the user wanted the method to include the given "startString" in the return result the method would not take into account the length of "startString" and would start counting from it's start. Thus the end result was one "startString" length shorter than what the user might have expected.
Now, if the user wants the return result to include the given "startString", the string, returned by the method will be "startString" + a substring of length "length", counted from the end of "startString".

  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0-deprecate 0 9/19/2021
1.1.1 202 11/10/2020
1.1.0 133 11/7/2020
1.0.1 153 7/21/2020
1.0.0 191 6/23/2020