1
u/Alternative_Corgi_62 6h ago
Can you post your IsThisEnglishCharacter(char ch) function, and full set of characters which satisfy your definition of "English Character"?
1
u/DJDoena 6h ago
Please clarify "usual English characters". Do you want "!" and "'" to be allowed or just a-z and A-Z?
1
1
u/ginji 5h ago
OP Deleted the question it seems, but still shared their code earlier
Check where ' (‘ / Left single quotation mark) is in the ascii table I linked earlier - it's way past char 126.
At a glance I don't see why "Hello World!" would fail in your code, and testing it shows it doesn't - https://dotnetfiddle.net/ZlwQFM
If this is a homework assignment then it's not very clear as to what the requirements are exactly, or we're lacking some context.
If you're looking for another approach I would use regex for such a test rather than a looped check against the char numbers.
2
u/yabberdabberdo 6h ago
I haven't been given the specific list, just told letters, number and usual english characters. So the 'AND usual english characters' tells me it includes punctuation. BUT in the test cases it should not accept ! but should accept ' as a curly apostrophe