Hi guys,
I'm kind of new at this and I seem to have very small experience on the C# language... I hope someone can help me out.
I need to built a console application that will read a card number with the following format ( 999-999999-9). The program needs to identify the la number which the verification digit . With the digit it determine if the card number is valid or not.
I started out using a long variable but it wont accept the "-" so i decided to use a string which it can take the entire statement as the software requires. How i can read the digits ignoring the "-" and storing the last number on a seperate variable?
Thanks
Reading Digits from String ... HELP!!!
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Reko10 pointsPosted Feb 13, 2007, 9:59 PM EST
string[] digits = code.Split('-');
int first = int.Parse(digits[0]);
int second = int.Parse(digits[1]);
int third = int.Parse(digits[2]);