Opening multiple links/ urls with GUI.TextArea

I’m working on an application where the user simply pastes multiple lines of links/ urls into a GUI.TextArea, and after that he will have all those links opened on his browser, each line of link being a different tab on the browser.

The problem I’m having is to tell unity how to differentiate the lines of links. In my tests I couldn’t tell the engine when a link ended and when the next one started, and the result was that just one tab opened with everything on the same URL - which obviously resulted in a broken page.

The correct way would be: if the stringA is written on the first line, stringA is the first link. Anything written on the second line would be the second link to be opened on another browser tab, and so on.

All I have atm is this:

var links : String = "Paste your links here...";

function OnGUI ()
{
	links = GUI.TextArea (Rect (10, 10, 200, 100), links);

	if(GUI.Button(Rect (10, 150, 200, 50), "Open!"))
	{
		Application.OpenURL(links);
	}
}

This should be simple… I have another small problem but I won’t flood this topic.
Thanks!

I think System.String.Split should be enough to turn the string from the text area into an array of lines.

Thank you very much for the reply!
I got the application to work as intended.

All I need now is to add some exceptions so the app would be able to open URLs that:
don’t start with www;
start with www;
start with http://;
start with http:// followed by www;
like:

unity3d.com
www.unity3d.com
http://unity3d.com
http://www.unity3d.com

Thank you.

Bump();