title: How to get the first portion of a string in a uri authority (android)
body: <p>I am currently working on a task and wondering how I can achieve this implementation. I have this unique URL, fake url here <code>https://home.ab.com</code> what I am trying to print out, is the first <code>home</code> after <code>//</code> not the <code>home</code> after the <code>.ab</code> let's call it company code. I know in a Uri, I can get the authority which as per documentation it returns this entire part <code>home.ab.com</code> My use case though is I only want to print out <code>home</code> based on unique companies and situation we support. How can I achieve this. This is what I have so far.</p>
  <p>my function <code>getCode(uri)</code> now where I am trying to get <code>home</code> is where I am stuck
  how can I get and return the home without the other part?</p>
  <pre><code>private fun getCode(uri: Uri): String{
     // todo
   }
  </code></pre>