When I use the code for the GUID generator which is present here:
I am getting this error Method does not exist or incorrect signature: StringUtils.charAt(String, Integer) at line 27 column 28
What why do I get this error?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
In the code in the question you linked to, the
charAt() method is included in the class, not in a class called
StringUtils, so unless you've put it in a class called
StringUtils you'll need to remove that part from the call to the method.
Alternatively, if you have put it in a class called
StringUtils, the problem may be that you haven't created an instance of the class:
StringUtils utils = new StringUtils(); utils.CharAt(aString, 4);
In which case, you probably meant to make the method static anyway and forgot the
static keyword in the code (the asterisks are for emphasis, they're not part of the code!):
global **static** String charAt(String str, Integer index)
All that aside, if you couldn't fix this yourself then chances are you need to learn a bit more about writing code in Apex before trying to build large pieces of functionality on the platform.