I do not think that str is assigned to selector. The whole “str => str.ToUpper()” is assigned:
Func<string, string> selector = ( str => str.ToUpper() );
where “str => str.ToUpper()” is a short form of a function that looks like this:
string MyFunction( string str )
{
return str.ToUpper();
}
Your anonymous compact form is added to selector.
Therefore, str is the name of function parameter.
To get the results, use something like this: string[] result = aWords.ToArray( ). Your function will be executed sequentially for all of items.