Lets say I have
string1 = "DDD DXXXX"
string2 = "DDXXXX"
string3 = "DXXXX"
and if i want to extract XXXX all the time, then what is the best way in c? substr, strncpy, strndup everything needs a starting position.
Is regex the only option?
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.
Use
strstr()to locate the"XXXX":