I have a generated string like this:
$x = jhgkjh**May**-**JUN**ojklkjh-jkl
I want to substitute every occurrence in $x of a month abbreviation with the number of the month. So the result will look like this:
$x = jhgkjh**05**-**06**ojklkjh-jkl
For that I created 2 arrays:
$months = "Jan", "Feb", etc...
$Nmonths = "01", "02" , etc...
This loop doesn't work:
$i = 0
do {
$x = $x.replace('$months[$i]','$Nmonths[$i]')
$i = $i+1
}
until ("$i" -eq "12")
$x
Please help !