How to get the first two numbers of an integer and the last two in c#.
For example:
int complete = 1935;
how to make,
int firtTwo = 19;
and
int secondTwo = 35;
Please help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Is it always a four-digit positive value? If so, I’d go for:
If it’s any arbitrary number, so you’d want “935” to be “93” and “35” you might as well use string operations:
(Note that this will blow up for single-digit values…)
It would help if you could say what this is meant to be for though.