Question: I am using WatiN to click links in the browser based on the string i pull off the site.

The problem is that some of the text it pulls is off of multiple lines, so it combines the string into 1 word. example: 
"Ultra Corrosion-Resistant Coated Alloy Steel" becomes "Ultra Corrosion-ResistantCoated Alloy Steel"

I am trying to split the string by all capital letters except ones that are hyphenated, so that i can start searching for links by portions of the string.

this is what i have so far

```
              types = doc.DocumentNode.SelectNodes("//h3[@class='AbbrPrsnttn_PrsnttnNm']");
                foreach (HtmlNode type in types)
                {
                    desc = type.InnerText.CleanText();

                    if (browser.Div(Find.ById("ProdPrsnttnGrpCntnr")).Element(Find.ByText(desc)).Exists)
                    {
                        browser.Div(Find.ById("ProdPrsnttnGrpCntnr")).Element(Find.ByText(desc)).Click();
                        System.Threading.Thread.Sleep(5000);
                        types = doc.DocumentNode.SelectNodes("//h3[@class='AbbrPrsnttn_PrsnttnNm']");
                        doc2.LoadHtml(browser.Html);
                        partTable = doc2.DocumentNode.SelectSingleNode("//div[@class='ItmTblGrp']");

                        MineNext(doc, doc2, browser, typeUrl, types, desc, partTable);
                    }

                    else
                    {
                        split = desc.Split(new Char[] { ' ' });

                    }

```

Answer: 
Here is an example of how it might be achieved:

**Updated** to also separate numbers.

```
using System;
using System.Text;

namespace SplitOnUppercase
{
    class Program
    {
        static void Main()
        {
            const string text = "Test42-10 UltraCorrosion-ResistantCoated Alloy-SteelNumberTest42";
            var result = new StringBuilder(text.Length);
            for (var i = 0; i < text.Length - 1; i++)
            {
                result.Append(text[i]);
                if (text[i] != ' ' && text[i] != '-' && (char.IsUpper(text[i + 1]) || !char.IsDigit(text[i]) && char.IsDigit(text[i + 1])))
                    result.Append(' ');
            }
            result.Append(text[text.Length - 1]);

            Console.WriteLine(result);
        }
    }
}

```
I'm pretty sure String.Split(Char[]) is case sensitive, but I cant test this at the moment.
I'm not at a computer where I can test or write c#, but this should work logically. There are probably a lot of syntax errors in this.

```
Char[] splitChars = {'A', 'B', etc....}; //what the string will be split by
string desc = inputString; // input string
string[] splitByCapital = desc.Split(splitChars);
string[] output = new string[splitByCapital.length];
for (int i = 0; i < splitByCapital.length; i++)
{
    if (splitByCapital[i].Contais("-"))
    {
        output = splitByCapital[i] + splitByCapital[i-1];
    }
    else
    {
        output = splitByCapital[i];
    }
}

```