Let me take an example to implement Trailing Zeros.
Example:-
---------------
1/
string strNumber="123";
In this strNumber, We will apply the Trailing Zeros and Which is given below,
string strTrailingNumber=strNumber.PadRight(6,'0');
So, the output of strTrailingNumber is "123000".
2/
string strNumber="";
In this strNumber, We will apply the Trailing Zeros and Which is given below,
string strTrailingNumber=strNumber.PadRight(6,'0');
So, here the output of strTrailingNumber is "000000".
0 comments:
Post a Comment