How to find the length of the string which also contains string terminating character in between. Example: ABC\0ABC. Is there any inbuilt function present which returns the length?
If the Input string is: ABC\0ABC
Output: 8
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.
Since the end of a C-style string is only detectable because it ends in a
'\0'character, what you’re asking isn’t solvable in a general way. If, like in your example, you know there’s exactly one'\0'character in the string, then you can simply do: