public int GetActualID_DeviceID() { int idx = ExternalID.LastIndexOf(" - "); idx += 3; //we need to point to the end of the search if (idx > ExternalID.Length - 1) { return(Id); } return(Convert.ToInt32(ExternalID.Substring(idx, ExternalID.Length - idx))); }
//Format is "location - 1" public int GetActualID_DeviceID(string location) { String strid = ExternalID.Substring(location.Length + 3, ExternalID.Length - location.Length - 3); return(Convert.ToInt32(strid)); }