Q:

function won't let me return string

This function below should in theory return a string("join") but when I write "return join;" it gives me an error saying: use of unassigned local variable "join". here is my code:
public string function(string input)
{
    string join;
    var token = input.Split('.').Select(p => Regex.Split(p, " ")).ToArray();
    for (int i = 0; i <= token.Length; i++)
    {
         join = string.Join(" ", token[i]);
    }
    return join;
}

I don't see any reason for that error to be caused! 

A:

join is being assigned only inside the "for", it means what happens if token.Length is 0? Join will never be assigned. You should initialize the variable: string joing = "";
Have a good day!

