Replace Characters from String by using CONVERTSTR Function:
(1) In this blog, we will get to know about the use of the CONVERTSTR function in BC D365. Replaces all characters in the source found in FromCharacters with the corresponding character in ToCharacters and returns the converted string.
(2) Note: The length of the FromCharacters parameter and the ToChars parameter must be the same, otherwise it returns an error. If the parameter FromCharacters or the parameter ToChars is empty, the source is returned unmodified. Both parameters are case-sensitive.
(3) Syntax of CONVERTSTR:
NewString := CONVERTSTR(String, FromCharacters, ToCharacters) |
(4) Now let’s take an example and see the result. In this example, we replace lowercase letters with uppercase letters, as shown.
- Message 1 is: Do you want to leave data without saving?
- Message 2 is: Do You Want to Leave Data Without Saving?
(5) Remarks from Microsoft, as shown.