✨ Community just got smarter! Our all-new AI search is live! ask anything in the search bar, get instant answers.

Equivalent to VB.Net's Chr() or C's (char)i in CRM Script

lock
push_pin
done
Beantwortet
2

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

 

22. Mai 2026 | 09:29 AM

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

26. Mai 2026 | 05:10 AM

Hi Sverre,

Thank you for this, looks promising.  I will give this a go 🙂.

Trevor

26. Mai 2026 | 08:37 AM

Antwort hinzufügen