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

Threaded View

  1. #1
    Join Date
    Jul 2006
    Posts
    4

    Extract substring from string

    i have a small console program that shows you, your ip and resolves from your ip your host name(reverse dns) and display then your ip and host name
    to the screen.
    an example output:
    Code:
    IP: 12.34.567.89
    Host Name: dslb-012-034-567-089.pools.myisp-ip.net
    now i want to convert the
    Code:
    dslb-012-034-567-089.pools.myisp-ip.net
    to
    Code:
    dslb.pools.myisp-ip.net
    or something similar.
    my goal is to remove the numbers and the "-" character from the host name string, because my ip is a dynamic ip and it changes every
    24hrs automatically. it should start to find the first "-" character and from there, until the first "." character or last
    number in the host name string and then cut out the found unneeded characters and then display the final host name string without the ip and
    the "-" character.
    i'm using msvc++ as compiler.

    how would i do that?

    any help and hints are more than welcome.
    Last edited by bigbang; September 17th, 2006 at 11:43 PM.

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