Hi,
Is there an equivilent in CRMScript to VB's Chr() where you can obtain a character from its ASCII code. I think the C equivelent is (char)i. But I cannot see how to do this is CRM Script. Bascially I need to change all instances of one character in a string into another character, but the original character is unprintable. I wanted to use the Ascii code to get the find part of the substitution, and replace it with a printable character such as a ~.
Many thanks,
Trevor
Alle Antworten (2)
Hi Trevor,
There is a function that allows you to create a String from a Byte[]. I have not tried, but something like this?
Byte b[];
b.pushBack(1); // The unprintable character
String replaceFrom = String(b);
String replaceTo = "~";
String s; // The string with the bad character
String replaced = s.substitute(replaceFrom, replaceTo);
Sverre
Hi Sverre,
Thank you for this, looks promising. I will give this a go 🙂.
Trevor