title: how to find index of the first capital letter in mysql, cyrillic characters
body: <p>I have a table with geographical names of places. Sometimes they have additional letters in front. for example if the city name is Astana then it is <code>s.Astana</code>. I need to get only the name of the place Astana. I want to use <code>substr</code>, but I can't find the index of first capital letter.Owh ya cyrillic characters are used that is also a problem.  I want to give some examples: </p>
  
  <ol>
  <li>Акмолинская область   -> Акмолинская</li>
  <li>Кокшетау Г.А.         -> Кокшетау</li>
  <li>г.Кокшетау            -> Кокшетау</li>
  <li>Красноярский с.о.     -> Красноярский</li>
  <li>с.Красный Яр          -> Красный Яр </li>
  </ol>
  
  <p>What i have tried: 
  created a field short_nameru and updated it this way </p>
  
  <pre><code>UPDATE center_kato ck SET ck.short_nameru = case when 
    LENGTH(SUBSTRING_INDEX(ck.nameru , ' ', -1)) &gt; LENGTH(SUBSTRING_INDEX(ck.nameru , ' ',1))
    then SUBSTRING_INDEX(ck.nameru , ' ', -1)
    else SUBSTRING_INDEX(ck.nameru , ' ',1) 
    END
  </code></pre>
  
  <p>and after that i updated it again </p>
  
  <pre><code>UPDATE center_kato ck SET ck.short_nameru = case 
    when LENGTH(SUBSTRING_INDEX(ck.short_nameru , '.', -1)) &gt; LENGTH(SUBSTRING_INDEX(ck.short_nameru , '.',1))
    then SUBSTRING_INDEX(ck.short_nameru , '.', -1)
    WHEN LENGTH(SUBSTRING_INDEX(ck.short_nameru , '.', -1)) &lt; LENGTH(SUBSTRING_INDEX(ck.short_nameru , '.',1)) 
    then SUBSTRING_INDEX(ck.short_nameru , '.',1)
    ELSE ck.short_nameru 
    END
  </code></pre>
  
  <p>but i lost some needed values. <code>"зимовка Туяк"</code> became <code>"зимовка"</code> but i needed <code>"Туяк"</code></p>