bryvee
alphabet Filter in C#?
Assuming I am understanding your request - This sounds like a perfect case for a regular expression.
Read up on them here: https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex?view=net-8.0
I'll save you some time and give you a hint; the expression string to match all alphabetic characters is [a-zA-Z]
You can inverse the match (get the punctuation, spaces, etc..) with this expression string [^a-zA-Z]
If you are confused by this, take a look at this page. https://regexone.com/ I recommend the interactive tutorial.
5 replies
Recommended resources for setup and learn C#
IDK how much it is recommended here, but if you have no experience with the ecosystem as a whole this is a good intro: https://www.thecsharpacademy.com/
Generally you can either use Visual Studio Community Edition or download the .NET SDK and use Visual Studio Code with the C# and .NET extensions.
5 replies