Skip to content

Commit

Permalink
Update README.md (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Maes authored Oct 10, 2023
1 parent 1f9ee6b commit a434f75
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A collection of useful extension methods for arrays in C#.
- **Basic Operations**: Easily `Add`, `Insert`, `Remove`, and `Replace` items.
- **Array Manipulation**: `Shuffle`, `Rotate`, `Chunk`, `Flatten`, and `Resize` your arrays.
- **Array Analysis**: Check if arrays are `AllEqual`, `AnyNull`, `IsEmpty`, or even find the `MostCommon` element.
- **String Array Utilities**: Methods like `TrimAll`, `AnyNullOrEmpty`, and `ConcatenateWithSeparator`.
- **String Array Utilities**: Methods like `TrimAll`, `AnyNullOrEmpty`, `ConcatenateWithSeparator` and filters.
- **DateTime Array Utilities**: Filter by `Weekdays`, `Weekends`, `Holidays`, and more.
- **Safe Operations**: Safely `Get`, `Set`, and `FindIndices` without worrying about out-of-range errors.
- **Functional Programming**: Use `ForEach` to apply actions directly on array elements.
Expand Down Expand Up @@ -46,6 +46,15 @@ bool hasEmptyOrNull = fruits.AnyNullOrEmpty();
// String utilities
string[] trimmedFruits = { " apple ", "banana ", " cherry", " date " };
trimmedFruits = trimmedFruits.TrimAll();
fruitsWithValues = fruitsWithValues.RemoveNullOrEmpty(); // Removes empty and null values, resulting in { "apple", "cherry" }
string[] fruitsWithSpaces = { "apple", " ", "cherry", null };
fruitsWithSpaces = fruitsWithSpaces.RemoveNullOrWhiteSpace(); // Removes whitespace-only and null values, resulting in { "apple", "cherry" }
bool hasDuplicateFruits = fruits.HasDuplicates(); // Checks if there are any duplicate fruit names
string fruitSentence = fruits.ConcatenateWithSeparator(", "); // Joins all fruit names with a comma separator
string[] fruitsWithPattern = fruits.FilterByPattern("^a.*"); // Filters fruits that start with the letter 'a'
bool allOfLengthFive = fruits.AllOfLength(5); // Checks if all fruit names have a length of 5
string longestFruit = fruits.LongestString(); // Gets the longest fruit name
string shortestFruit = fruits.ShortestString(); // Gets the shortest fruit name
// DateTime utilities
DateTime[] holidays = { new DateTime(2023, 12, 25), new DateTime(2023, 1, 1) };
Expand Down

0 comments on commit a434f75

Please sign in to comment.