Parsing String Response from API call

Parsing String Response from API call

Hello!

Does anyone have an idea on how I could handle a string response to an API call formatted as follows:

"Found|2~222.0|2019~2~21~22~59~43~2019~2~22~0~11~31~324~324~1~9718225~z688876|2019~2~22~0~12~38~2019~2~22~1~17~4~120~169~0~9718290~zg88877|"


The key values are those highlighted in bold. What I need to do is translate the string of numbers and provide a text phrase to my users. So, the above would mean: "Passed Content Test", "Passed Application Test 1a."

I'm getting stumped as to how I can break down the string to validate the key numbers. In the above string:
  • The bold "2" means the student took the test 2x
  • The bold "1" means the student passed the test
  • The bold "z688876" is the specific id that identifies the type of test
The numbers themselves change based on the type of test, the date, the student's score, etc., so I can't always count the string integers and expect them to be in the same places.

Any ideas would be appreciated!