Clearing leading and trailing blanks from a string in C Shell

Does anyone know of a way with C Shell that will work on both Linux and Sun to clear all leading and trailing blanks from a previously specified string? I am using the following code to replace blanks with underscores:

set Company = `echo $Company | sed 's/ /_/g

but I don't want any leading or trailing underscores. The string was originally defined using:

set COMPLine = `grep  -i "COMPANY" $LASInputFile`
set Company = `echo $COMPLine | sed 's/^[^ ][^ ]* *\([^:][^:]*\)[ ][ ]*:.*/\1/'`

Thanks for any help

How about this:

# echo "  Acme Consultants Pty Ltd   " | sed -e 's/^ *//' -e 's/ *$//' -e 's/ /_/g'
Acme_Consultants_Pty_Ltd