I have a string 0023525631 but what I want is the string 23525631 — without the leading zeroes. How do I do this?
I have a string 0023525631 but what I want is the string 23525631 —
Share
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.
You can convert string to integer and integer to string if you are number.
Or
Declarate pointer to this string and set this pointer to a start of your string, then iterate your string and add to this pointer number of zeros on the start of string. Then you have pointer to string who starting before zeros, you must use pointer to obitain string without zeros, if you use string you can get string with zeros.
Or
You can reverse string, and iterate it from reverse, if you get some
char != '0'you stop iterating else you rewriting this char to null. After it you can reverse string to get back your integer in string without leading zeros.