Please I need help to do this in PowerShell using array. I have an array similar to $a below:
$a = @('**ABC**:XYZ','**LMN**:PQR','**ABC**:RST','YJQ:PRS','**LMN**:SDK')
I want to change the $a array to $b:
$b = @('**ABC**:XYZ,RST','**LMN**:PQR,SDK','YJQ:PRS')
The idea is that all items that have common values before ":" should be combined in the format like "common_value:x,y,z" but others without common values should be left alone. Any hint or solution will be appreciated.