I have weird string that I want to inspect by printing its characters one by one. How can this be done?
I’m worried in case it has any special characters that may obstruct its printing. Can they be ‘escaped’?
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 could loop over the string, printing the characters one by one, and conditionally choosing to print the character or an escape sequence:
This prints one character per line, with control characters printed in hex format.