I have a string and index in that string, and want to get the first position of a substring before that index.
e.g., in string:
\"this is a test string tha
So you want the last index before a given index...
var myString = "this is a test string that contains other string for testing"; myString = String.SubString(0, 53); var lastIndexOf = myString.LastIndexOf("string");