Abhiz
Abhiz

Reputation: 1030

How to make query string values case insensitive in angularjs?

From the here I get to know about the case sensitivity of the query string keys. But my query is regarding the case sensitivity the query string value. Is it possible to make the query string values case insensitive? Can it be possible to get same result when i hit the below two urls?

http://eventabc.com/test/#/?layout=1&name=WCC 

and

http://eventabc.com/test/#/?layout=1&name=wcc 

If there is any way please give me some solution in angularjs.

Upvotes: 1

Views: 1632

Answers (1)

Ramesh Rajendran
Ramesh Rajendran

Reputation: 38663

If you are using IIS express, Whenever you provide uppercase in query string the URL is automatically converted to lower case. Because this is happened in IIS express.

So you need to move hosted project to local IIS instead of IIS express, and the automatic lowercase redirect is gone

Please find this discussion: Angular 2 Route Param automatically converting to lowercase on localhost but remains capitalized on server

If you want to know the value is uppercase or lowercase, then please try this below way

if (value== value.toLowerCase())
{
  // The character is lowercase
}
else
{
  // The character is uppercase
}

Upvotes: 2

Related Questions