How do I locate the last occurrence of string in a string?
Is there a function which would search for the last occurrence of a certain substring and return the index of it?
For example, if I want to search for the last occurrenc开发者_如何学JAVAe of the char '\
' in a file path 'C:\Program Files\Microsoft
'.
string.LastIndexOf
You look for
"somesthing".LastIndexOf("char/string");
You can use: string.LastIndexOf(String)
精彩评论