Last Position of a Character


#1

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


#2

Use .LastIndexOf(char)

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


#3

Thanks…
Your answer is rigth