If the last 4 mapName characters are equal to '.bsp', then they are removed from the string.
'^0' is espace character for the integer 0. It it used to not use an integer, and let the code reader know that mapName stores an string instead of a array on integers.