Just out of curiosity, are you trying to write code to zero pad or some other way format strings? If so, there are probably existing commands to do that for you.
[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
Just as a quick example, if you wanted to 0 pad a number out to 2 digits:
$a = 5
"{0:0#}" -f $a
[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
You are correct, i'm trying to add a 0 to a single digit number from 1 to 9. i just assigned 5 in $a, if you notice the question is about square brackets in a switch command.
I understood the question, and crobin1 had already provided a good answer. I was just suggesting an alternate solution to what you were trying to do.
[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.