AWK - Print partial line/partial field

Hello, this is probably a simple request but I've been toying with it for a while.

I have a large list of devices and commands that were run with a script, now I have lines such as:

a-router-hostname-C#show ver

I want to print everything up to (and excluding) the # and everything after it
the hostname portion is variable in size so basically I just want to find # and cut it and everything else after it to just end up with:
a-router-hostname-C

if I do a {print $1} I of course cut off the last field of "ver" but still have the "#show" portion.

Thanks in advance!

sed 's/#.*//' file

or:

awk -F"#" '{print $1}' file
$ ruby -ne 'print $_.split("#")[0]' file

If you have the line in a variable:

var='a-router-hostname-C#show ver'
echo ${var%\#*}