function getSubstringBeforeChar (string, char) {
  return string.slice(0, string.indexOf(char))
}
@description Returns the substring before a certain character in a string.
@param {'String'} string
@param {'String'} char