How to get particular character position from string using C#

后端 未结 1 477
时光说笑
时光说笑 2021-01-06 08:38

This is very basic question but I am not able to find the position of a particular character. For example:

string a = \"ABCDE\"; 

I want th

1条回答
  •  清歌不尽
    2021-01-06 08:49

    Use IndexOf

    var pos = a.IndexOf('E');
    

    0 讨论(0)
提交回复
热议问题