I have this ginormous string that is downloaded that contains data. I then use the string.split operation to break it down into usable parts.
When I run this operation unity freezes momentarily. Id like to run this operation ASYNC to avoid the freeze. But even as a coroutine I still get the same problem.
Any ideas on how to avoid a freeze on a process intensive operation?
Im using C#.
EDIT:
working code
private IEnumerator SplitStringAsync(string str, string delimitor)
{
string workingStr = str;
int currentIndex = 0;
int foundDelimitorIndex = workingStr.IndexOf(delimitor,currentIndex);
while(foundDelimitorIndex != null)
{
string newString = workingStr.Substring(currentIndex,foundDelimitorIndex);
workingStr = workingStr.Replace(newString, "");
foundDelimitorIndex = workingStr.IndexOf(delimitor,currentIndex + 1);
newString = newString.Replace(delimitor, "");
Debug.Log (newString);
yield return null;
}
}