Help Needed – IDM Script – Unable to Replace Dash with Slash in Date Format]
Hi everyone,
I'm currently working on an IDM script to format a date string. I’m trying to replace space(
) with slashes (/
) using the replace()
function like this:
String $rep5 = replace($rep4, ' ', '/');
However, this throws an error — it seems the /
is being interpreted as a division operator instead of a character, which causes the script to fail.
I’ve also tried the following workarounds, but none of them seem to work:
- Escaping the slash:
\/
, \\\/
- Using ASCII code:
chr(47)
- idmCopyEditString $slash = "/";String $rep5 = replace($rep4, '-', $slash);
- HTML entity:
"/"
- Unicode:
"\u002F"
None of these approaches solve the issue — the script still throws an error or ignores the replacement.
Has anyone encountered this before?
Is there a known workaround or a safe way to insert a /
character in a string within an IDM script?
Thanks in advance for your help!