/ Published in: ActionScript 3
In AS2 forward slashes got url-encoded to %2F when you escaped them. But in AS3 they get ignored and left as they are. In some situations I have found that this can cause problems. So you can do it manually using this regular expression.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var myString:String = "/"; trace(myString); var urlEncodeForwardSlashedRegExp:RegExp = new RegExp("/", "gi"); myString = myString.replace(urlEncodeForwardSlashedRegExp, "%2F"); trace(myString); // OUTPUT // / // %2F