For all we know, it could be something like this:
public class FormatString
{
public int containsAlpha(object foo)
{
return 0;
}
}
That would satisfy the example you showed. It doesn't even need a constructor definition.
You should right-click and "go to definition" to find out what it really does.
UPDATE
Based on your updated details, If you could use a newer .NET Framework, I'd say you could replace the entire function with this:
using System.Linq;
public static bool ContainsAlpha(string s)
{
return s != null && s.Any(Char.IsLetter);
}
But since you are stuck, this should work just as well:
public static bool ContainsAlpha(string s)
{
if (s == null) return false;
for (int i = 0; i < s.Length; i++)
if (Char.IsLetter(s, i))
return true;
return false;
}
Or alternatively:
public static bool ContainsAlpha(string s)
{
if (s == null) return false;
for (int i = 0; i < s.Length; i++)
if (Char.IsLetter(s[i]))
return true;
return false;
}