Skip to main content

Notifications

Community site session details

Community site session details

Session Id :

How to check every character of a string by looping in D365. #ax #dynamics #D365

Krishna Bhardwaj Profile Picture Krishna Bhardwaj 97
Here I'm going to show how we can iterate over characters of the string to perform a particular operation.
I'm using the standard string function subStr() to return each character.

str strValue = 'Krishna Kant';
str newStr;           
for (int i = 1; i<= strLen(strValue); i++)
{
    if (subStr(strValue, i, 1) != " ")
    {
        newStr += subStr(strValue, i, 1);
    }
}
Output: KrishnaKant

 

Comments

*This post is locked for comments