Like this:
public Sample(string str) : this(int.Parse(str)) { }
More Related Contents:
- Virtual member call in a constructor
- Can constructors be async?
- Why must “stride” in the System.Drawing.Bitmap constructor be a multiple of 4?
- What’s the difference between an object initializer and a constructor?
- How to do constructor chaining in C#
- Why can’t the C# constructor infer type?
- C# member variable initialization; best practice?
- Interface defining a constructor signature?
- ‘UserControl’ constructor with parameters in C#
- C# Error: Parent does not contain a constructor that takes 0 arguments
- When is a custom attribute’s constructor run?
- What setup code should go in Form Constructors versus Form Load event?
- Using C# reflection to call a constructor
- Constructor of an abstract class in C#
- Is there an alternative to bastard injection? (AKA poor man’s injection via default constructor)
- Inheritance with base class constructor with parameters [duplicate]
- C# inheritance and default constructors
- Struct constructor: “fields must be fully assigned before control is returned to the caller.”
- The type ‘…’ has no constructors defined
- C# – Making all derived classes call the base class constructor
- Why are constructors not inherited in C#?
- C# static class constructor
- Is the “textual order” across partial classes formally defined?
- what is ‘this’ constructor, what is it for
- Automatically implemented property in struct can not be assigned
- Is it possible to override a constructor in C#?
- How to inherit constructors?
- How do I check if a type provides a parameterless constructor?
- a constructor as a delegate – is it possible in C#?
- Closing a form during a constructor