Here is what I need done - I have a variable $port this variable outputs on a list with different variables($port equals between S0 through S36 I was wondering if there is an easy way to format $port to do the below:
Say $port equals S1 then I would like it to be S01
Say $port equals S11 then I would like it to stay the same
(so what I would like done is add a zero after the S if the number is a single digit number)
I was hoping I would be able to do something like:
$port=formatstringcommand($port)
I beleive the command I need to use is the printf command but I'm not quite sure how to us it.
Any help would be appreciated.
%, 2004
Say $port equals S1 then I would like it to be S01
Say $port equals S11 then I would like it to stay the same
(so what I would like done is add a zero after the S if the number is a single digit number)
I was hoping I would be able to do something like:
$port=formatstringcommand($port)
I beleive the command I need to use is the printf command but I'm not quite sure how to us it.
Any help would be appreciated.
%, 2004