Tuesday 5 May 2020

remove first characters in D365 ax 2012 X++ code

X++ CODE TO REMOVE first or starting CHARACTERS.

use the below code to remove the last character of a string in ax .

strDel(noteDescription,1,1)

str strDel(
    str _text,
    int _position,
    int _number)

Example:

using strDel function Note: removes 2 letters from 4th letter onwards

info(strDel("1Description",1,1));

Result : Description

Similarly the number of characters can be increased or descreased.
Below code will remove the last 3 characters from the string.
Str example = 'Example123';
info(strDel(example, strLen(example) -2, 3));

Output : 'Example'

Thanks,
Vikas Mehta.


No comments:

Post a Comment

AZURE INTERVIEW QUESTIONS AND ANSWERS

AZURE INTERVIEW QUESTIONS AND ANSWERES 2021 2. What is cloud computing? Explanation:  It is the use of servers on the internet to “store...