Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- json SplitString(string fullstring, string substring)
- {
- json result = JsonArray();
- int index = FindSubString(fullstring, substring);
- while (index > -1)
- {
- result = JsonArrayInsert(result, JsonString(GetSubString(fullstring, 0, index)));
- // if this is too high, it's ok, it just goes to the end of the string
- int stringLength = GetStringLength(fullstring);
- fullstring = GetSubString(fullstring, index + GetStringLength(substring), stringLength);
- index = FindSubString(fullstring, substring);
- }
- result = JsonArrayInsert(result, JsonString(fullstring)); // include all to the end of the string
- return result;
- }
Advertisement