hello i am a beginner in objective-c
i have a nsstring like this
Select * from Store_Master where AND VDivison = 'Casual Dining' AND VBrand_Name = 'Pinkberry' AND VCountry_Name = 'Egypt' AND VCity = 'Cairo' AND VBuilding_mall_name = 'Dandy Mega Mall' GROUP BY VStore_Name
i want to just remove first occurance of AND,how can i remove.
Thank you in advance
Use
stringByReplacingCharactersInRangeto replace only the first ‘AND’:That would result in:
EDITED:
If you want to remove the occurrences of
ANDin a case insensitive way (no matter uppercase of lowercase), use theNSStringCompareOptionswhen you create the NSRange, like this:The rest of the code is the same.