I need a clarification to find the instring in C#. Generally we can use indexof to find if the given string/character is present. But if i use any special characters in that matching string, it doesnt match it..
i want to find out "obj_name" in the "objectname,obj_name" string.
if i use string.indexof("obj_name") >0 , it doesnt validated this bcoz of the "_" character. so how can i solve this..
for timebeing i have used RegEx to slove this..
but suggestion pls
first i think you mean sub-string rather than 'instring'. what is an instring anyway?
second, i tested your sample code snippet and it worked fine, returning True. So apparently there is no problem.
also, personally I find regex is a very powerful solution and you shouldn't think of it as a kludge.
Using RegEx is the *politically correct* way of doing things. But IMO, if you can do something that's alot simplier and understandable, do it.
I haven't tried whether indexof is valid with "_" character, but I guess felite has already checked it out.