Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class URLs
- {
- static void Main()
- {
- string texiInput = "The site nakov.com can be access from http://nakov.com or www.nakov.com. It has subdomains like mail.nakov.com and svetlin.nakov.com. Please check http://blog.nakov.com for more information.";
- FindURL(texiInput);
- }
- static void FindURL(string textInput)
- {
- for (int i = 0; i < textInput.Length; i++)
- {
- if((textInput[i] == 'h' && textInput[i + 4] == ':')
- || (textInput[i] == 'w' && textInput[i + 1] == 'w' && textInput[i + 3] == '.'))
- {
- while(true)
- {//за да избегна точката накрая
- if (textInput[i] == '.' && textInput[i + 4] == ' ')
- {
- break;
- }
- Console.Write(textInput[i]);
- i++;
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment