Salesforce Fact #268 | Iterate over string in apex
Apex does not support char data type. So, suppose we have to iterate over the characters over a string. We can use substring() method to get the characters at each index.
Attached are the screenshots.
We can use char inside string class an easy way, but your way is also good.
ReplyDeleteThanks.
Delete