def truncate_before(value, srch):
 before_index = value.find(srch)
 if (before_index >= 0):
  return value[:before_index]
 else:
  return value

def truncate_before ( value , srch ) : before_index = value . find ( srch ) if ( before_index >= 0 ) : return value [ : before_index ] else : return value
return content of str before the srch parameters .