I'm trying to convert a string containing BBcode colours into the old 3.xx style. It seems to work partially (It converts the first few, but not others). This is the code I'm using at the moment:
code:
for(var a=0;a<=54;a++){
var before = "[c="+a+"]";
var after = "·$"+a+" ";
strMyNewPSM = strMyNewPSM.replace(before,after);
}
Debug.Trace(strMyNewPSM);
strMyNewPSM = strMyNewPSM.replace('[/c]','·$1');
Messenger.MyPersonalMessage = strMyNewPSM;
Any ideas why its not working properly?
Also, I need to remove leading spaces... I know how to check for them, but not how to remove them.