Git Product home page Git Product logo

erymuzuan / spanextensions.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from draconware-dev/spanextensions.net

0.0 0.0 0.0 835 KB

SpanExtensions.Net aims to make ReadOnlySpan<T> and Span<T> more accessible and overall better integrated into the .Net Ecosystem, by providing alternatives for many missing Extension Methods for Span<T>, ranging from string.Split() over Enumerable.Skip() and Enumerable.Take() to an improved ReadOnlySpan<T>.IndexOf().

License: MIT License

C# 100.00%

spanextensions.net's Introduction

SpanExtensions

NuGet Badge

About

ReadonlySpan<T> and Span<T> are great Types in C#, but unfortunately working with them can sometimes be sort of a hassle and some use cases seem straight up impossible, even though they are not.

SpanExtensions.Net aims to help developers use ReadonlySpan<T> and Span<T> more productively, efficiently and safely and write overall more performant Programs.

Never again switch back to using string instead of ReadonlySpan<T>, just because the method you seek is not supported.

SpanExtensions.Net provides alternatives for many missing Extension Methods for ReadonlySpan<T> and Span<T>, ranging from string.Split() over Enumerable.Skip() and Enumerable.Take() to an improved ReadOnlySpan<T>.IndexOf().

Methods

The following Extension Methods are contained:

String Methods made available for ReadonlySpan<T> and Span<T>:

  • (ReadOnly-)Span<T>.Split(T delimiter)
  • (ReadOnly-)Span<T>.Split(T delimiter, int count)
  • (ReadOnly-)Span<T>.Split(T delimiter, StringSplitOptions options)
  • (ReadOnly-)Span<T>.Split(T delimiter, StringSplitOptions options, int count)
  • (ReadOnly-)Span<T>.Split(ReadOnlySpan<T> delimiters)
  • (ReadOnly-)Span<T>.Split(ReadOnlySpan<T> delimiters, int count)
  • (ReadOnly-)Span<T>.Split(ReadOnlySpan<T> delimiters, StringSplitOptions options)
  • (ReadOnly-)Span<T>.Split(ReadOnlySpan<T> delimiters, StringSplitOptions options, int count)
  • (ReadOnly-)Span<T>.SplitAny(ReadOnlySpan<T> delimiters)
  • (ReadOnly-)Span<T>.SplitAny(ReadOnlySpan<T> delimiters, int count)
  • (ReadOnly-)Span<T>.SplitAny(ReadOnlySpan<T> delimiters, StringSplitOptions options)
  • (ReadOnly-)Span<T>.SplitAny(ReadOnlySpan<T> delimiters, StringSplitOptions options, int count)
  • (ReadOnly-)Span<T>.Remove(int startIndex)
  • Span<T>.Replace(T oldT, T newT)

Linq Methods made available for ReadonlySpan<T> and Span<T>:

  • (ReadOnly-)Span<T>.All(Predicate<T> predicate)
  • (ReadOnly-)Span<T>.Any(Predicate<T> predicate)
  • (ReadOnly-)Span<T>.Average()
  • (ReadOnly-)Span<T>.Sum()
  • (ReadOnly-)Span<T>.Skip(int count)
  • (ReadOnly-)Span<T>.Take(int count)
  • (ReadOnly-)Span<T>.SkipLast(int count)
  • (ReadOnly-)Span<T>.Takelast(int count)
  • (ReadOnly-)Span<T>.SkipWhile(Predicate<T> condition)
  • (ReadOnly-)Span<T>.TakeWhile(Predicate<T> condition)
  • (Readonly-)Span<T>.First()
  • (Readonly-)Span<T>.First(Predicate<T> predicate)
  • (Readonly-)Span<T>.FirstOrDefault()
  • (Readonly-)Span<T>.FirstOrDefault(Predicate<T> predicate)
  • (Readonly-)Span<T>.FirstOrDefault(T defaultValue)
  • (Readonly-)Span<T>.FirstOrDefault(Predicate<T> predicate, T defaultValue)
  • (Readonly-)Span<T>.Last()
  • (Readonly-)Span<T>.Last(Predicate<T> predicate)
  • (Readonly-)Span<T>.LastOrDefault()
  • (Readonly-)Span<T>.LastOrDefault(Predicate<T> predicate)
  • (Readonly-)Span<T>.LastOrDefault(T defaultValue)
  • (Readonly-)Span<T>.LastOrDefault(Predicate<T> predicate, T defaultValue)
  • (Readonly-)Span<T>.Single()
  • (Readonly-)Span<T>.Single(Predicate<T> predicate)
  • (Readonly-)Span<T>.SingleOrDefault()
  • (Readonly-)Span<T>.SingleOrDefault(Predicate<T> predicate)
  • (Readonly-)Span<T>.SingleOrDefault(T defaultValue)
  • (Readonly-)Span<T>.SingleOrDefault(Predicate<T> predicate, T defaultValue)
  • (Readonly-)Span<T>.ElementAt(int index)
  • (Readonly-)Span<T>.ElementAt(Index index)
  • (Readonly-)Span<T>.ElementAtOrDefault(int index)
  • (Readonly-)Span<T>.ElementAtOrDefault(Index index)
  • (Readonly-)Span<T>.ElementAtOrDefault(int index, T defaultValue)
  • (Readonly-)Span<T>.ElementAtOrDefault(Index index, T defaultValue)
  • (Readonly-)Span<T>.Min()
  • (Readonly-)Span<T>.Min(Func<TSource, TResult> selector)
  • (Readonly-)Span<T>.MinBy(Func<TSource, TKey> keySelector)
  • (Readonly-)Span<T>.MinBy(Func<TSource, TKey> keySelector, IComparer<TKey> comparer)
  • (Readonly-)Span<T>.Max()
  • (Readonly-)Span<T>.Max(Func<TSource, TResult> selector)
  • (Readonly-)Span<T>.MaxBy(Func<TSource, TKey> keySelector)
  • (Readonly-)Span<T>.MaxBy(Func<TSource, TKey> keySelector, IComparer<TKey> comparer)

Contributing

Thank you for your interest in contributing to this project - Please see Contributing!

License

Copyright (c) draconware-dev. All rights reserved.

Licensed under the MIT License.

spanextensions.net's People

Contributors

dragon7307 avatar sadtobenep avatar guiorgy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.