Hallo I would like to create an extension method for Char
class that works as Char.IsDigit()
method (but that will of course recognize a differnt type of characters).
I wrote this:
namespace CharExtensions
{
public static class CompilerCharExtension
{
public static Boolean IsAddOp(this Char c)
{
return c.Equals('+') || c.Equals('-');
}
}
}
that works fine but that it's not exactly what I meant. This extension should be used this way:
using CharExtensions;
char x:
...
if(x.IsAddOp())
Console.WriteLine("Add op found");
While I would something like this:
using CharExtensions;
char x;
...
if(Char.IsAddOp(x))
Console.WriteLine("Add op found");
Thanks to everyone who could help me.