0
let str = "<h1>Test</h1><h2>Test2</h2><h3>Hello, playground</h3><h3>Test</h3>"
str.split(separator: "<h3>")

I have the code above, and I get the error `Cannot convert value of type 'String' to expected argument type 'String.Element' (aka 'Character')

Leo Dabus
  • 229,809
  • 59
  • 489
  • 571
Chris Hansen
  • 7,813
  • 15
  • 81
  • 165

1 Answers1

0

Could you try below code instead of your 2nd line?

    str.components(separatedBy: "<h3>")
Peter
  • 126
  • 1
  • 4