How to

get the last index of character in string

Published: 14. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » Strings
Tags: Basics C# Text
Was this snippet helpful for you? YESYES / NONO
string text = "tests";
int index = text.LastIndexOf("s");

Console.WriteLine(index);
Console Output:
4
Send us feedback about this snippet »



Related Snippets: