You need to sign in to do that
Don't have an account?
Need help with using the reverse method
Im having an error with my code. Not really familiar with reverse method. Need help with checking this and creating a simple test class.
this is the code that I got so far:
public class Example {
public static void reverseWordInMyString(String str){
List<String> str = new List<String>{''};
List<String> reversedString = new List<String>();
if(!str.isEmpty()){
for (String s : str){
reversedString.add(s.reverse());
}
}
System.debug(str);
System.debug(reversedString);
}
}
Thanks in advance
All Answers
1) https://trailhead.salesforce.com/modules/apex_testing
Pleasse check below post sample test class
1) http://amitsalesforce.blogspot.com/2015/06/best-practice-for-test-classes-sample.html
Also please check below post
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_test.htm
2) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_example.htm
Sample Test Class for you
Let us know if this will help you
Let us know if this will help you