stuart-d2
10/7/2014 - 2:00 PM

String : LastIndexOf & Substring. Used for getting a substring, such as when you want to grab only a certain part of a URL.

String : LastIndexOf & Substring. Used for getting a substring, such as when you want to grab only a certain part of a URL.

/*Defines the series name I believe.  Takes the full seriesUrl, retrieves a substring, passing in parameters LastIndexOf.  LastIndexOf reports the index position of the last occurrence of a specified unicode character or string within the instance. Returns -1 if not found. Here, it will return the index position of the last occurance of "/".  StringComparison.Ordinal is the search mechanism that compares string using ordinal sort rules -- sorting that ignores 'natural language', instead makes decisions based on simple byte comparisons and ignores casing.  Last +1 I assume moves the index up one value.*/  

var seriesName = seriesUrl.Substring(seriesUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);