Chris Anderson

Chris Anderson

  • NA
  • 93
  • 8.3k

Append string to int in datagridview column?

Mar 6 2021 3:15 PM
I want to add a string after the age declaration. Depending if it is a dog or a puppy I want to add either "year" or "month" after. Is this possible?
 
  1. string name;  
  2. int age;  
  3.   
  4. Animal cat = new Cat();  
  5.   
  6. cat.Name = name;  
  7. cat.Age = age + "months";  // This I want to add a string after the int value
  8. Petowner.Pets.Add(cat);  
 
Excuse me for my drawing skills :) 

Answers (3)