Last Position of a Character

How can I find the position of the last character in string?
for example
LastPos=Str find the last (“a”)
Result 3
It is said, taking the last positions of the letter “a”

Use .LastIndexOf(char)

string myString="Salam"; int lastA = myString.LastIndexOf("a"c); // = 3

1 Like

Your answer is rigth