I have an HTTPResonse that when you get the body looks like this:
I want to get the Id from it to use later and I'm having trouble figuring out how to dynamically say start at Project/ and end at "}. The reason is that the id seems to change in length each time.
I did have
String i = response.getBody().subString(16,45);
but it fails if the length changes. I think I should do something like this to get the index of the last " and then use that as the length but I can't get it to compile.
String i = response.getBody().substring(16, indexofChar('"',16));
The error is:
Method does not exist or incorrect signature: void indexofChar(String, Integer)
What am I doing wrong?