how do I chop of characters at the end of a line...

Páxina inicial
Anexos:
Mensaxe orixinal
+ (text/plain)
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Entelin
Data:  
Asunto: how do I chop of characters at the end of a line...
I want to take a variable say a="string.txt" and chop off the last 4
characters so I can make variable b equal to just "string"

Thanks for your help