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.
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
*This post is locked for comments