Page 1 of 1

Left padding

Posted: Thu Dec 07, 2006 6:12 am
by vij
hi,
I want to know how 0s are left padded to a string.
i used this function - padstring(sting,"0",10) but it does a right padding.

I tried with -10 for a left pad, even then it is not working... can anyone help me on this?

Posted: Thu Dec 07, 2006 6:33 am
by ray.wurlod

Code: Select all

Str("0", 10-Len(MyString)) : MyString

Thanks

Posted: Wed Dec 13, 2006 8:11 am
by lottokahe
ray.wurlod wrote:

Code: Select all

Str("0", 10-Len(MyString)) : MyString
...

Thank you Ray. That is exactly what i needed.
Greetings,

Sven

Posted: Wed Dec 13, 2006 3:04 pm
by ray.wurlod
Welcome aboard. :D