Here is the snippet of code I use to remove the extra space that WordPress adds to the end of <li> elements when you use wp_nav_menu to call in a menu:
<?php $custommenu = wp_nav_menu ( array (
'menu' => 'my-custom-menu',
'container' => '',
'container_id' => '',
'menu_class' => '',
'menu_id' => '',
'echo' => 0
) );
$custommenu = str_replace("\n", "", $custommenu);
$custommenu = str_replace("\r", "", $custommenu);
echo $custommenu;
?>

