Raphe

public static bool In(this string Value, params string[] ValuesToCompare)
{
bool IsIn = false;
foreach (string ValueToCompare in ValuesToCompare)
{
if (Value == ValueToCompare)
{
IsIn = true;
}
}
return IsIn;
}
Example:
Console.Write("test".In("tes", "ew", "test")); // - true
Console.Write("test".In("tes", "ew")); // - false

Description

Compare Strings like in SQL

Details

  • Author: Raphe
  • Submitted on: 9/4/2013 11:08:30 AM
  • Language: C#
  • Type: String
  • Views: 2289

Double click on the code to select all.

 

;