0

Input string examples are as follows, It may contains white space,

  • example 1: abc?contains(\"good\")

    example 2: abc? contains(\"good\")

    example 3: abc ?contains(\"good\")

    example 4: abc ? contains(\"good\")

Answer for all above should be : abc CONTAINS(\"good\")

Note : regular expression have to remove all white space and Question mark and replace small case "contains" with upper case "CONTAINS".

Alan Moore
  • 73,866
  • 12
  • 100
  • 156
Sandeep
  • 766
  • 5
  • 16
  • Check out these links- [link1](http://stackoverflow.com/questions/9276246/how-to-write-regular-expressions-in-objective-c-nsregularexpression) and [link2](http://www.raywenderlich.com/30288/nsregularexpression-tutorial-and-cheat-sheet) might be helpful. If u want particular code for this condition do ping. – nikhil84 Sep 09 '14 at 09:08
  • replace `[? ]+contains[(]` with ` CONTAINS(` ? – Kent Sep 09 '14 at 09:22

0 Answers0