2

I need to dissect a String into multiple parts to put into an array. The string needs to be split at a specific set of characters.

For example: If I need to split this string at each "{=" occurrence, the string:

"{=hello{=secondindex{=stuffhere"

would turn into an array like this:

["hello", "secondindex", "stuffhere"]

Help is very much appreciated, I thank you in advance.

2
  • 2
    If your string will always start with "{=" "{=hello{=secondindex{=stuffhere".components(separatedBy: "{=").dropFirst() Commented Jan 20, 2017 at 2:34
  • 2
    @LeoDabus You're beautiful, exactly what I needed. Commented Jan 20, 2017 at 2:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.