String.Contains Case Sensitive
String.Contains Case Sensitive
Case Sensitive String.Contain
String.Contains vs IndexOf .Net
I encountered an issue with string contains couple of days ago... well, the fact is - it has no
StringComparison for culture and Case Sensitivity.
I found a better way to do this, and I just wanted to share in a short post:
string bookTitle = "The Old Man and the Sea";
if (bookTitle.IndexOf("the old man") > -1)
{
// this is case sensitive
}
if (bookTitle.IndexOf("the old man", StringComparison.OrdinalIgnoreCase) > -1)
{
// this is ignore case
}
There are some more options in the StringComparison , but I'll leave it to you to play with
Good day,
Elad Shalom,
CTO at ITweetLive.com
Case Sensitive String.Contain
String.Contains vs IndexOf .Net
I encountered an issue with string contains couple of days ago... well, the fact is - it has no
StringComparison for culture and Case Sensitivity.
I found a better way to do this, and I just wanted to share in a short post:
string bookTitle = "The Old Man and the Sea";
if (bookTitle.IndexOf("the old man") > -1)
{
// this is case sensitive
}
if (bookTitle.IndexOf("the old man", StringComparison.OrdinalIgnoreCase) > -1)
{
// this is ignore case
}
There are some more options in the StringComparison , but I'll leave it to you to play with
Good day,
Elad Shalom,
CTO at ITweetLive.com
nike free, louis vuitton outlet online, chanel handbags, oakley sunglasses, burberry outlet online, air max, tiffany and co, ray ban, prada outlet, ray ban sunglasses, burberry outlet online, louboutin, longchamp outlet, louboutin, coach outlet store, polo ralph lauren outlet, oakley sunglasses, jordan shoes, oakley sunglasses, coach factory outlet, coach outlet, nike shoes, michael kors outlet, gucci outlet, coach purses, coach factory, tory burch outlet, prada handbags, oakley sunglasses, toms shoes, louis vuitton handbags, true religion jeans, true religion outlet, kate spade outlet, ray ban sunglasses, true religion, polo ralph lauren, nike air max, oakley sunglasses, michael kors outlet
ReplyDeleteHi, Neat post. There's an issue with your site in internet explorer, may
ReplyDeletecheck this? IE still is the marketplace leader and a big
part of other people will leave out your magnificent writing due to this problem.
Stop by my site: home inspection brooklyn
jianbin0623
ReplyDeletecartier watches for sale
chrome hearts outlet
soccer jerseys
michael kors handbags
louis vuitton handbags
fitflops sale
burberry outlet sale
michael kors factory outlet
cheap nhl jerseys
camisetas futbol baratas
oakley sunglasses wholesale
ferragamo outlet
rolex watches outlet
ray-ban sunglasses
ralph lauren polo
beats by dre
rolex watches
prada handbags
hermes outlet
reebok outlet store
longchamp handbags
coach outlet store
pandora jewelry
air max 90
herve leger outlet
tory burch outlet online
mulberry outlet,mulberry handbags outlet
ray-ban sunglasses
polo ralph lauren
true religion outlet
ray ban sunglasses
ralph lauren uk
lululemon uk
pandora
ReplyDeletepolo outlet
ugg outlet
michael kors outlet
red bottoms
oakley sunglasses outlet
nmd adidas
pandora jewelry
michael kors outlet
fit flops
20161021caiyan
true religion jeans
ReplyDeleterolex replica watches
toms shoes outlet
louis vuitton bags
armani exchange
moncler outlet
ysl outlet online
coach factory outlet
kate spade handbags
true religion outlet
20161117caiyan