CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 20

Threaded View

  1. #15
    Join Date
    Jul 2002
    Location
    Portsmouth. United Kingdom
    Posts
    2,727

    Re: determining if a string is an ip address or a hostname?

    Code:
    bool ContainsAlpha(const std::string& s)
    {
      return(std::string::npos != s.find_first_not_of("0123456789.:"); 
    }
    Last edited by JohnW@Wessex; March 6th, 2009 at 09:26 AM. Reason: Incorrect code
    "It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
    Richard P. Feynman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured