0

Hey,

Is there a way, by using find, to create a method that finds the last occurrence of a character in a string?

I know how to use the find method to find the first occurrence but have no idea how to do it backwards.

Basically this is what I want to do:

#Say I have the following string:

stringA = 'abcded'

#I want to be able to print out the position of the last 'd',
#which should be 5 instead of 3 (the position of the first 'd'
1
Contributor
1
Reply
6
Views
6 Years
Discussion Span
Last Post by nickecarlo
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.