Skip to content

Instantly share code, notes, and snippets.

@kbens
Last active August 14, 2020 15:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbens/10470609 to your computer and use it in GitHub Desktop.
Save kbens/10470609 to your computer and use it in GitHub Desktop.
String Manipulation in PeopleCode
Local string &foo = "This is a foo string.";
Local string &start_key = "Th";
Local string &end_key = ".";
Local integer &start_pos = Find(&start_key, &foo) + Len(&start_key);
Local integer &end_pos = Find(&end_key, &foo);
Local string &result = Substring(&foo, &start_pos, &end_pos - &start_pos);
/* &result will now equal "is is a foo string" */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment