Skip to content

Adjust String Property In An Object (Model,Dto,Entity) As Simple As Possible

Notifications You must be signed in to change notification settings

ARFarokhi/AdjustStringProperties

Repository files navigation

Summary

AdjustStringProperties is a .NET library which find all String Properties in an Object (Model,Dto,Entity) that have Setter and Adjust them. this packge Built in .NetStandard 2.0

How To Install

Install With Package Manager Console

  • Install-Package AdjustStringProperties

Install With NuGet Package Manager

How To Use

First Let's Create Person Class:

 public class Person
    {
        public string Name { get; set; }
        public string LastName { get; set; }
        public string FullName => $"{Name} {LastName}";
        public string Description { get; set; }
    }

Then Create Person Object:

var person = new Person()
            {
                Name = "John",
                LastName = "Smith",
                Description = "John Smith Description"
            };

Now We Can Use Package Like This:

 person.AdjustString();

Let's See How AdjustStringProperties Package Can Help:

1-Trim String Peoperties

if User Input Data Is Like Bellow

var person = new Person()
            {
                Name = "      John      ",
                LastName = "   Smith ",
                Description = "John Smith Description"
            };

As you Can See Bellow:

After Use of Package It Will Be Like Bellow:

2-Replace Multiple Spaces With Single

if User Input Contains More Than 1 Space Between Words together ,Spaces Will Replace Will 1 Space . look at "Description" property Bellow:

var person = new Person()
            {
                Name = "John",
                LastName = "Smith",
                Description = "John        Smith        Description"
            };

After Use of Package It Will Be Like Bellow:

Note:

more features are in Progress and will be add to Package

About

Adjust String Property In An Object (Model,Dto,Entity) As Simple As Possible

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages