We're creating a big script and need to generate some HTML-code. This all works fine and I've collected all the info I need in the array $HTMLcode.
I'm still a bit of a noob in array/string manipulation, so I was wondering if its possible to insert a line of text above every line in the array HTMLcode that starts with the text ERROR?
$HTMLcode=@()
$HTMLcode += "ERROR: Problem 1<br>"
$HTMLcode += "You did this wrong.. <br>"
$HTMLcode += "ERROR Problem 2<br>"
$HTMLcode += "Something happened here.. <br>"
$HTMLcode += "ERROR Porblem 3<br>"
$HTMLcode += "Did you try.. <br>"
Desired result would be:
$HTMLcode=@()
$HTMLcode += "--------------------------<br>"
$HTMLcode += "ERROR: Problem 1<br>"
$HTMLcode += "You did this wrong.. <br>"
$HTMLcode += "--------------------------<br>"
$HTMLcode += "ERROR Problem 2<br>"
$HTMLcode += "Something happened here.. <br>"
$HTMLcode += "--------------------------<br>"
$HTMLcode += "ERROR Porblem 3<br>"
$HTMLcode += "Did you try.. <br>"
Thank you for your help.