How can I check if a string contains all question marks? Like this:
string input = \"????????\";
So many linq answers! Can't we do anything the old-fashioned way any more? This is an order of magnitude faster than the linq solution. More readable? Maybe not, but that is what method names are for.
static bool IsAllQuestionMarks(String s) {
for(int i = 0; i < s.Length; i++)
if(s[i] != '?')
return false;
return true;
}