OK. I'm not sure that the '<<' and '>>' means in your question. I'm assuming that your are not talking about merge fields which use those kinds of brackets to insert variables in a line of text on a layout. Correct me if I'm wrong.
Substitute( Substitute ( container_name ; ".jpg" ; "" ) ; ".JPG" ; "")
The calculation above can be used in several different ways to get you the output you want. One way would be to use it in the definition of a new calculated field that strips the '.jpg' off of the contents of container_name. You could also use it in a script that strips the .'jpg' off of your text field and replaces it with the new value. This script could be initiated by the user with a button on your layout or, more automatically, by attaching it to a script trigger ('On Save') on the container_name field.
The way you implement it will depend on how you would like your solution to behave. Am I making sense?
P.S. When you specify the calculation to a script or to a field definition, I'd suggest using the built-in tools for picking field names and commands. That way you won't forget to add in the table name for related fields (e.g. Related Table::container_name). Also you will make fewer syntax mistakes in the commands themselves (or inherit my mistakes).