I found lots of tutorials for substring, indexOf, lastIndexOf. But when you throw in slashes and positioning, it's hard to understand how to get the strings from an exact position. Here's my questions.
I would like to retrieve the user name from the following URLs with just a few lines of code:
http://www.flickr.com/photos/username/http://www.flickr.com/photos/username/2197658314/http://www.flickr.com/photos/username/2197658176/in/photostream/Notice it's always "photos/" then the username. How can I use Substring indexOf lastIndexOf to retrieve it?
Start Free Trial