Are .NET string operations case sensitive?

前端 未结 4 2334
时光说笑
时光说笑 2021-02-20 09:33

Are .NET string functions like IndexOf(\"blah\") case sensitive?

From what I remember they aren\'t, but for some reason I am seeing bugs in my app where the

4条回答
  •  梦毁少年i
    2021-02-20 10:20

    One thing I'd like to add to the existing answers (since you were originally asking about ASP.NET):

    Some name/value collections, such as the Request.QueryString and probably also Request.Form are not case-sensitive. For example if I navigate to an ASPX page using the following URL

    http://server/mypage.aspx?user=admin
    

    then both of the following lines will return "admin":

    var user1 = Request.QueryString["user"];
    var user2 = Request.QueryString["USER"];
    

提交回复
热议问题