1

I want to change the variable name to the string I entered.

For example :

public int MyVariable;
public string Name="MyName";

I want Rename 'MyVariable' to 'MyName'.How ?

s.m.m
  • 105
  • 2
  • 9

1 Answers1

2

You can't because C# is a strongly-typed language.

See Types (C# Programming Guide).

C# is a strongly-typed language. Every variable and constant has a type, as does every expression that evaluates to a value. Every method signature specifies a type for each input parameter and for the return value. The .NET class library defines a set of built-in numeric types as well as more complex types that represent a wide variety of logical constructs, such as the file system, network connections, collections and arrays of objects, and dates. A typical C# program uses types from the class library as well as user-defined types that model the concepts that are specific to the program's problem domain.

jegtugado
  • 5,081
  • 1
  • 12
  • 35