String replacement, regular expressions
I'd like to do string replacement in the pre
block of a rule using regular expressions. I know there is开发者_JAVA技巧 a function to do that, but I can't find it. Hints?
I'm thinking something like this:
origStr = "Original-string-has-hyphens";
newStr = origStr.replace(re/-/ /g);
The result being that newStr = "Original string has hyphens"
.
EDIT: Just realized that I asked a similar question a few months ago, but I never quite got a working answer.
Documentation can be found at http://docs.kynetx.com/docs/Replace I found it using my Kynetx docs search tool http://supersearcher.michaelgrace.org/
what about origStr.replace("-", " ");
精彩评论