I'm taking a C# intro class so we're not using anything complicated, just methods and loops. I've been trying to research and find more information on how to use string methods for this email check assignment we're supposed to do. But every time I look for anything, I get regex which I'm not allowed to use.
I was just hoping if anyone familiar with string methods or just simply experienced in coding, could help point me in the right direction of where to start or give an example of a string method that checks if a character is after a certain spot or if a string character is actually there.
I was thinking of using the IndexOf
method but the professor didn't show us too well of how to implement it in a method and return it back to the main method.
Would that be a good place to start? I know that if I use IndexOf
to check if an "@" sign is or is not in the hardcoded email address, I would get either the index number of where it is at or a -1 if it is false. How would that be used in a method to return in the main method?