Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

PascalName seperate strings

    string[] testCollection = new string[] { "AutomaticTrackingSystem", "XSLT", "aCamelCaseWord" };
    foreach (string test in testCollection)
    {
        // if it is not the first character and it is uppercase
        //  and the previous character is not uppercase then insert a space
        var result = test.SelectMany((c, i) => i != 0 && char.IsUpper(c) && !char.IsUpper(test[i - 1]) ? new char[] { ' ', c } : new char[] { c });
        Console.WriteLine(new String(result.ToArray()));
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #PascalName #seperate #strings
ADD COMMENT
Topic
Name
4+5 =