Just like the GetAt method of the CString type in C++, whats the equivalent function in c# to get the character at a particular index in a string?
Asked
Active
Viewed 1.0k times
-3
-
Atleast justify the downvote! – Tyler Durden Oct 11 '13 at 16:28
-
2you are supposed to do minimum efforts before posting : http://stackoverflow.com/questions/3581741/c-sharp-equivalent-to-javas-charat – fmgp Oct 11 '13 at 16:28
-
This kind of question you should just Google :/ – what is sleep Oct 11 '13 at 16:29
-
2Stop! Please have mercy! Can I delete this question and get my points back? – Tyler Durden Oct 11 '13 at 16:31
4 Answers
0
Treat the string as an array.
var testString = "blah";
Console.WriteLine(testString[2]);
Writes...
a

Tom Bowers
- 4,951
- 3
- 30
- 43