Storing single_tag_title in variable
single_tag_title accepts two arguments. $prefix and $display. $prefix sets the string which should be echoed/returned before the tag, and $display determines whether the tag is echoed or returned as a variable. See the documentation here.
$tagSlug = single_tag_title("", false);echo $tagSlug;