Auto Complete length of string with default value

Hello,

i have problem, so i have string ‘1’ but i have to make it ‘00001’ and if value ‘12’ it would be ‘00012’. i’ve trying using count length then calculate it.
example : ‘12’ would be 2, so i have to calculate it 5-2=3. after get 3 then looping to add string before the value : value_loop+input_value= ‘00012’
am i right? or any other idea more faster than this?
please help.

Thankyou

@aliaga,

Try like this

Convert.ToInt32( "12").ToString("D5")
3 Likes

Hello @sarathi125,

Thankyou it work faster than looping.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.