Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

escape chars for regex c#

// Don't actually do this to check containment... it's just a little example.
public bool RegexContains(string haystack, string needle)
{
    Regex regex = new Regex("^.*" + Regex.Escape(needle) + ".*$");
    return regex.IsMatch(haystack);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: C# Async Function with await 
Csharp :: linq select to list 
Csharp :: c# sbyte 
Csharp :: c# list object 
Csharp :: c# string across multiple lines 
Csharp :: unity GetNestedComponentsInChildren 
Csharp :: except method c# 
Csharp :: create enum from int c# 
Csharp :: how to move mouse with c# 
Csharp :: dotnet create web api 
Csharp :: c# linq join mutiple 
Csharp :: inheritance in c# 
Csharp :: datetime show 24 hour format c# 
Csharp :: datatable in c# 
Csharp :: static keyword 
Csharp :: sqlite execute 
Csharp :: access denied tring to save a file uwp xamarin 
Csharp :: c sharp type in word and calculate how much a letter is inside that word 
Csharp :: why does everything reset when switching scene unity 
Csharp :: dadar pincode 
Csharp :: nuget package TSETMC guide 
Csharp :: camera follow player unity 
Csharp :: clear highlight winforms treeview 
Csharp :: sdl quit event not working multiple windows 
Csharp :: C# Convert range 
Csharp :: how to navigate between page in wpf 
Csharp :: hierachical table to c# class 
Csharp :: How to add a button to a column in the DataGridView 
Csharp :: checkbox on change c# xamarin forms 
Csharp :: how to find all role in mysql 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =