Answers for "how to see if a variable is in a class in c#"

C#
1

how to see if a variable is in a class in c#

MyClass myClass = new MyClass();

try
{
  	// varToFind is the variable that you want to see if it is
  	// in the class
	if (myClass.varToFind != "")
    {
    	print("This variable name is in class");
    }
	
	else
    {
    	print("The variable is in the class it is just set to nothing");
    }
}

catch:
{
	print("Variable is not in stringbuilder");
}
Posted by: Guest on May-28-2021

Code answers related to "how to see if a variable is in a class in c#"

C# Answers by Framework

Browse Popular Code Answers by Language