Skip to content

Instantly share code, notes, and snippets.

@ganmahmud
Last active November 21, 2018 06:49
Show Gist options
  • Select an option

  • Save ganmahmud/ff0096d2dbe0d04cb1c46cabd1266471 to your computer and use it in GitHub Desktop.

Select an option

Save ganmahmud/ff0096d2dbe0d04cb1c46cabd1266471 to your computer and use it in GitHub Desktop.
Create an Apex class with a method that returns an array (or list) of strings.
public class StringArrayTest {
public static String[] generateStringArray(Integer numOfStrings) {
// Create a generateStringArray object
String[] stringArr = new List<String>();
for(Integer i=0;i<numOfStrings;i++) {
stringArr.add('Test '+i);
}
return stringArr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment