0

I would like to do a case insensitive search for a string within another, starting from the rear end of the source string. I've tried the following:

let r = s.rangeOfString( substr.toString(), options: (NSStringCompareOptions.BackwardsSearch | NSStringCompareOptions.CaseInsensitiveSearch) )

But Swift complains that I can't use the "|" operator to combine the options (also tried '+'). What's the syntax here? Thanks

rawhide
  • 49
  • 4
  • 2
    This is certainly a duplicate. This now uses set style notation `[NSStringCompareOptions.BackwardsSearch, NSStringCompareOptions.CaseInsensitiveSearch]`. – vacawama Dec 20 '15 at 23:18
  • Thanks, @MartinR, you found the duplicate before I did! – vacawama Dec 20 '15 at 23:24

0 Answers0