I uploaded the pages including my header.php
to wordpress and my header have auto generated  
in it together with #text.
I tried adding this code but nothing happens.
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
Are there any solutions for this?
Edit:
This is where " " shows up:
https://i.sstatic.net/yvQgI.jpg
So your theme is outputting  
in the "nav menu items". So try to use the following code, see if it removes those extra spaces!
add_filter( 'wp_nav_menu_objects', 'rempving_extra_spaces_from_nav_menu_items', 999);
function rempving_extra_spaces_from_nav_menu_items($items)
{
$items = str_replace(' ', '', $items);
return $items;
}
Code goes into your functions.php
file of your theme.