Here's a way you could do it:
public int GetNumberOfLink()
{
string[] links = rtb.Text.Split(' '); //Splits the text in your rtb when there's a space, and store every spilted element into a string array.
return links.Count(); //return the number of string in the array.
}
then, it can be called this way:
public void SomeMethods()
{
//some code
int nbOfLinks = GetNumberOfLink();
//some code
}