I have this following code:
I get the error, \"Use of un-Assigned Local variable\"
I\'m sure this is dead simple, but im baffled..
public string ret
Change your line from
string result;
To
string result = string.Empty; // or null depending on what you wish to return (read further)
The compiler is just saying "Hey, you are using result and it has not been assigned yet!". This even ocurrs when you are assigning it for the first time, if you're not doing so in the initial instantiation.
You will also want to consider how you need to handle your code if you return an empty string, due to your array argument being passed in empty. You could choose to return an empty string, or a null value. This is just a behaviorial decision.