Friday 6 May 2016

Add leading zero's / characters


It's been over a year since my last update, ouch, but here is a note to myself. I needed to add leading zero's to strings which were too short. In order to do so, use the strRFix function. It takes your string, counts the number of characters and adds leading characters (zero's in my case).

I had different lengths of strings but I always needed six characters, filled with leading zero's. The outcome in the first place was: 
51070
4690
372

I needed six characters, which can be accomplished with the following command: 
strRFix(inputString,6,'0');

it will result in: 
051070
004690
000372

Perfect :). 


No comments:

Post a Comment