ExtensionMethod.NET Home of 876 C#, Visual Basic, F# and Javascript extension methods

Like SQL on C#

An C# extension method based on "LIKE" operator of T-SQL.


public static class StringExtensions
	public static bool Like(this string value, string search)
		return value.Contains(search) || value.StartsWith(search) || value.EndsWith(search);


using System;
using System.Collections.Generic;

public class Program
	public static void Main()
		string stringValue = "the brown fox jumped over the lazy dog";
		string searchCondition = "fox";
//Will Return True

Author: Rafael Tadeu Bezerra Faria

Submitted on: 29 jun 2018

Language: C#

Type: object

Views: 5555