Bonus points for converting the first link (http://www.example.com) to http://www.example.com/ in the HREF (add the omitted slash).
Be cautious of mechanically adding a trailing slash to a "directory" name. While doing this is usually desirable, there are some exceptions. As an example, Google's linux search page does not like this:
http://www.google.com/linux -> linux specific search page
http://www.google.com/linux/ -> 404 error
I'm not aware of any site where it is a problem to add a trailing slash to a domain name, but it's only a matter of time before someone finds a new way to be too clever for their own good.