Check out example codes for "add spaces between words unity". It will help you in understanding the concepts better.

Code Example 1

public string AddSpacesToSentence(string text)
{
    if (string.IsNullOrWhiteSpace(text))
      return "";
      
    StringBuilder newText = new StringBuilder(text.Length * 2);
    newText.Append(text[0]);
    for (int i = 1; i < text.Length; i++)
    {
      if (char.IsUpper(text[i]) && text[i - 1] != ' ')
        newText.Append(' ');
      newText.Append(text[i]);
    }
    return newText.ToString();
}

Learn ReactJs, React Native from akashmittal.com