TheNormalPotato TheNormalPotato - 3 months ago 5
C# Question

Changing name of a data type

I want to "rename" a data type, like change the name of

int
to
Newint
or
bool
to
Newbool


Is there any way of accomplishing this?

Answer

You don't have a "typedef" in c# You can use this:

using NewInt = int;

I'm not sure that it works on primitives like int and bool (try it), but it'll work on regular classes

Warning: it'll only work in the same file it was written