Introduction

In the previous article, we have demonstrated even if Eval SQL.NET is one of the fastest and scalable method to split string with a delimiter.

In this article, you will learn about the flexibility of the library.


SQL Split String & Access Index

Problem

You need to split a string and return the ordinal index value specified from a parameter.

Solution

All LINQ Element Operators are supported including array index accessors

  • values[ordinal]
  • ElementAt()
  • First()
  • FirstOrDefault()
  • Last()
  • LastOrDefault()

Example


SQL Split String & Aggregate Values

Problem

You need to split a string and perform an aggregate operators on all values.

Solution

All LINQ Aggregate Operators are supported

  • Average
  • Aggregate
  • Count
  • Min
  • Max
  • Sum

Example


SQL Split String & Array Index

Problem

You need to split a string and return the array index.

Solution

All LINQ Projection Operators are supported

  • SELECT(x => func)
  • SELECT((x, index) => func)

Example


SQL Split String & Order By Values

Problem

You need to split a string and order value by alphabetical order.

Solution

All LINQ Ordering Operator are supported

  • OrderBy
  • OrderByDescending

Example


SQL Split String & Remove Duplicate Values

Problem

You need to split a string and remove all duplicates.

Solution

All LINQ Set Operators are supported

  • Distinct

Example


SQL Split String & Filter with Where

Problem

You need to split a string and filter values

Solution

All LINQ Restricition Operators are supported

  • Where

Example


SQL Split String & Partitioning

Problem

You need to split a string and only return a subsets of all values

Solution

All LINQ Partitioning Operators are supported

  • Take
  • TakeWhile
  • Skip
  • SkipWhile

Example


SQL Split String Trim

Problem

You need to split a string and trim it.

Solution

All C# instance string methods are supported

  • Substring
  • Trim
  • TrimEnd
  • TrimStart
  • Etc.

Example


SQL Split String & Unsplit / Concatenate Result

Problem

You need to split a string, make some operations and concatenate the result.

Solution

All C# static string methods are supported

  • String.Join
  • String.Format
  • Etc.

Example


Share your experience

  • What's features is missing?