NSString *x=@"\"/Sagar\' and \'Samir\' ";
Now, I want to remove characters between these.
\" /
\'
Intended output
x = (should have) @"and \'Samir\'"
So, Ms word give some options in find & replace, using wild card characters. ( just giving example )
Is it possible in cocoa?
You could also use NSScanner on this quite easily. A quick read through this will give you all you need to know:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Strings/Articles/Scanners.html#//apple_ref/doc/uid/20000147-BCIEFGHC
I'll assume you're looking for a solution in general -- not for this particular string. You'll want to learn about regular expressions.
For regular expression support in Objective-C check out RegexKitLite. It provides category methods on NSString that support various regex matching and substitution.
You could use straight C stuff. Here is a regex library allowing you to use NSString. This site has a small example of use.