Declaration
// this extends the 'string' type
// this is self-referencing
// returns int
public static int toInt(this string value)
{
return int.Parse(value);
}
Usage
return Console.ReadLine().toInt();
- Log in to post comments
Tags
