I have a string of variable length and I know the index position is 25. As it’s variable in his length (>= 25), I need a way to locate the negative index of that same position for easier data manipulation.
Do you have any idea how this can be done?
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.
I’m not sure if this is what you’re after, but if you have the index of a string, the ‘negative’ index is just the negative of the length of the string minus the index:
Or using the example from the comments: