I have a string in this format: “ABC_123_”
I want to end up with and integer variable that is just the number portion of the string. What is the most efficient way to accomplish that in C#?
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.
This should be efficient enough. Don’t sweat if it’s not the most efficient unless profiling tells you that it’s a bottleneck of your application:
Without more information about your problem, this is what I would go with.