Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Fill variable with leading zero's

$
0
0

Hi guys,

variable given $Number="21" or $Number="0" ... I now have to set this variable into a length of 8 chars with pre "0"'s ...

e.g.

$Number ="21" should become "000021" or $Number="434" should become "000434" ...

Since I am a complete newby at powershell scripting can anyone give me any hint/idea/function ?!

Thanks in advance,

Markus


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>