0

I need to get the part of the string with the web url from which load a web image, I need to do it from multiple images, put them in an array then use on a collection view. I used:

let singleArrayWithHTML = valueToCheck
let fileArray = singleArrayWithHTML.components(separatedBy: "href=")

in order to get the string below, but I cannot trim it further, and I cannot use a fixed index as and point, since the url could change in future

"http://example.com/uploads/2018/06/5.jpg" data-  lightbox="lightbox-357e45b7" class="vce-image-masonry-gallery-item"><img class="vce-image-masonry-gallery-img" src="http://example.com/wp-  content/uploads/2018/06/5.jpg" alt=""></a></div><div class="vce-image-masonry-gallery-column"><a
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
biggreentree
  • 1,633
  • 3
  • 20
  • 35

0 Answers0