title: C: Get substring before a certain char
body: <p>For example, I have this string: <code>10.10.10.10/16</code></p>
  
  <p>and I want to remove the mask from that IP and get: <code>10.10.10.10</code></p>
  
  <p>How could this be done?</p>