title: C# Sort string array alphabetically taking care of putting strings which start with capital letter first. first
body: <p>1) There is a Kata which states to order all string in a string array, then take the first word and add *** between each letter: <a href="https://www.codewars.com/kata/sort-and-star" rel="nofollow noreferrer">https://www.codewars.com/kata/sort-and-star</a></p>
  
  <p>2) For example:</p>
  
  <p>(1) It is given:</p>
  
  <pre><code>bitcoin
  take
  over
  the
  world
  maybe
  who
  knows
  perhaps
  </code></pre>
  
  <p>(2) After ordering it:</p>
  
  <pre><code>bitcoin
  knows
  maybe
  over
  perhaps
  take
  the
  who
  world
  </code></pre>
  
  <p>(3) The return result is:</p>
  
  <pre><code>b***i***t***c***o***i***n
  </code></pre>
  
  <p>3) However the difficulty I am facing is the following: How we can express 'order first the words which start with capital letter'?</p>
  
  <p>4) I have tried the following code:</p>
  
  <pre><code>using System;
  public class Kata
  {
    public static string TwoSort(string[] s)
    {
    foreach(string str in s){
      Console.WriteLine(str);
    }
    Console.WriteLine("");
    Array.Sort(s);
    foreach(string str in s){
      Console.WriteLine(str);
    }
  
    Console.WriteLine("");
  
    string firstWord = s[0];
    string result = "";
  
  
    foreach(char letter in firstWord){
      result += letter + "***";
  
    }
    Console.WriteLine(result.Substring(0, result.Length - 3));
      return result.Substring(0, result.Length - 3);
    }  
  }
  </code></pre>
  
  <p>5) For example:</p>
  
  <p>(1) It is given the following array:</p>
  
  <pre><code>Lets
  all
  go
  on
  holiday
  somewhere
  very
  cold
  </code></pre>
  
  <p>(2) After ordering it:</p>
  
  <pre><code>all
  cold
  go
  holiday
  Lets
  on
  somewhere
  very
  </code></pre>
  
  <p>(3) Current wrong result:</p>
  
  <pre><code>a***l***l
  </code></pre>
  
  <p>(4) Expected correct result:</p>
  
  <pre><code>L***e***t***s
  </code></pre>
  
  <p>I have also read:</p>
  
  <p><a href="https://stackoverflow.com/questions/3148767/how-to-sort-a-string-array-by-alphabet">how to sort a string array by alphabet?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/16636554/sorting-an-array-alphabetically-in-c-sharp">Sorting an array alphabetically in C#</a></p>