The above code will take care as the method PadLeft will implicitly check whether the number of characters in the string Number is equal or less than the first parameter for the method and then add the second parameter of the method to the string accordingly.