Search
Setup for Free
C
C#
Argument 2 cannot convert from 'method group' to 'Funcchar, bool'
Original message was deleted
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,250
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Similar Threads
❔ Convert void to bool
C
C# / help
3y ago
❔ Argument 1: cannot convert from 'Ardalis.Result.Result' to 'TResponse'
C
C# / help
3y ago
Iterator (Argument 1 cannot convert from 'Coding.Exercise.Nodechar[]' to 'char*' Compilation failed)
C
C# / help
4y ago
T
TheBoxyBear
•
9/5/22, 8:28 PM
It can
't find an overload of the method that matches the signature of the delegate
A
Anar
•
9/5/22, 8:29 PM
letter
letter
is a
char
char
, I do not think
char
char
s have
Contains
Contains
method
.
T
TheBoxyBear
•
9/5/22, 8:30 PM
What do you mean by a letter containing a character
?
T
TheBoxyBear
•
9/5/22, 8:30 PM
The letter is the character
A
Anar
•
9/5/22, 8:30 PM
How would a letter contain a
char
char
? It is already a
char
char
.
A
Anar
•
9/5/22, 8:31 PM
Did you mean to type
specialCharacters.Contains(letter)
specialCharacters.Contains(letter)
?
T
TheBoxyBear
•
9/5/22, 8:31 PM
Just use a lambda in Any that compares the character to the letter
T
TheBoxyBear
•
9/5/22, 8:32 PM
yes
T
TheBoxyBear
•
9/5/22, 8:33 PM
np
V
Verracciii
like this? `if((specialCharacters.Any(s => letter == s)))`
A
Anar
•
9/5/22, 8:39 PM
Why do it with linq
A
Anar
Did you mean to type `specialCharacters.Contains(letter)`?
A
Anar
•
9/5/22, 8:39 PM
That is just this
A
Anar
•
9/5/22, 8:41 PM
You can
.
T
TheBoxyBear
•
9/5/22, 8:45 PM
Could start by comparing the character values instead of every number on the range
A
Anar
•
9/5/22, 8:45 PM
Because that is not how ranges work
.
T
TheBoxyBear
•
9/5/22, 8:45 PM
if
<
-26 or
> 26
A
Anar
•
9/5/22, 8:45 PM
It takes starting value and count
, so that returns
[-26, 0)
[-26, 0)
.
T
TheBoxyBear
•
9/5/22, 8:45 PM
That too
T
TheBoxyBear
•
9/5/22, 8:48 PM
Might have to cast the char to a number first
A
Anar
•
9/5/22, 8:48 PM
Nah
, it is implicitly casted
.
T
TheBoxyBear
•
9/5/22, 8:48 PM
Then yeah just use comparison operators
V
Verracciii
what about if it isnt?
A
Anar
•
9/5/22, 8:48 PM
Then you check if it is either less than
-26 or greater than 26
.
A
Anar
•
9/5/22, 8:51 PM
T
TheBoxyBear
•
9/5/22, 8:52 PM
Enumerable
.Range is more useful for explicitely doing something with all numbers
T
TheBoxyBear
•
9/5/22, 8:52 PM
In your old code
, it would go
"is it
-26
? is it
-25
? is it
-24
?
.
.
.
" all the way to 0
A
Anar
•
9/5/22, 8:53 PM
Mhm
, linq abuse
.
letter
letter
Contains
Contains
specialCharacters.Contains(letter)
specialCharacters.Contains(letter)
[-26, 0)
[-26, 0)