Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# Predicate delegate

//one of three built-in generic delegate types:

static bool IsUpperCase(string str)
{
    return str.Equals(str.ToUpper());
}

static void Main(string[] args)
{
    Predicate<string> isUpper = IsUpperCase;

    bool result = isUpper("hello world!!");

    Console.WriteLine(result);
}
Comment

c# predicate

Predicate<string> isUpper = delegate (string s) { return s.Equals(s.ToUpper()); };
bool result = isUpper("hello world!!");

Console.WriteLine("Predicate Delegate "+result);
Comment

PREVIOUS NEXT
Code Example
Csharp :: make variables in c# 
Csharp :: unity reference textmeshpro 
Csharp :: unity rotate around axis 
Csharp :: convert int32 
Csharp :: Show private fields in Unity Inspector 
Csharp :: uri file path c# 
Csharp :: linq query select where c# 
Csharp :: c# regex find last match 
Csharp :: c# encrypted 
Csharp :: default parameter c# 
Csharp :: add spaces in string 
Csharp :: custom click event wpf button 
Csharp :: All Possible SubString 
Csharp :: what value of combobox index c# 
Csharp :: meaning immutable and mutable 
Csharp :: c# scroll to bottom of datagridview vb.net 
Csharp :: c# foreach namevaluecollection 
Csharp :: defualtsize UWP c# 
Csharp :: c# draw rectangle on screen 
Csharp :: C# Switch and case 
Csharp :: c# convert double to string 
Csharp :: c# get date without time 
Csharp :: quaternion rotation unity 
Csharp :: delete all rows from table mvc 
Csharp :: unity unit tests 
Csharp :: unity dotween sequence 
Csharp :: c# convert date to oracle format 
Csharp :: properties in c# 
Csharp :: wpf relativesource 
Csharp :: sucess messages in c# 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =