ソースコード
public static class CharExt { public static int ToInt( this char self ) { return self - '0'; } }
使い方
char ch = '1' int num = ch.ToInt();
public static class CharExt { public static int ToInt( this char self ) { return self - '0'; } }
char ch = '1' int num = ch.ToInt();