English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Write a program called URL, that reads from the standard input, keyboard input, a commercial web site URL. You should expect that the URL starts with www and ends with .com After reading the input you should out the url . excluding the www. and the .com

Sample Input
Please enter a url:
www.yahoo.com

Sample output
yahoo

2007-03-07 16:09:58 · 2 answers · asked by LULU 1 in Computers & Internet Programming & Design

2 answers

Agreed. Just check the www and the com thing and you can also use the split thing using the . as the parameter for breaking the string and bringing the site name.

It should bring you an array like
www
yahoo
com

You just need to select the 1 ( since arrays start at 0 ) postion.

2007-03-08 02:55:31 · answer #1 · answered by Anonymous · 0 0

Look up "token orginizer" and you will want to have it recognize the "." as seperator. Its not hard, but people shouldnt write your homework for you.

2007-03-08 00:14:30 · answer #2 · answered by sasukechaos 2 · 0 0

fedest.com, questions and answers