I have a JS var that holds string whose content is like this Automated - UI & Functional Regression on iPhone 6 running iOS 9. Similarly I have other string values as:
Automated - Under the Hood: iPhone 6 running iOS 9
Automated - AU/NZ: iPhone 6 running iOS 9
Automated - DRM: iPhone 6 running iOS 9
Automated - Ads regression: iPhone6 running iOS 9
Automated - Ads regression: iPhone 5 running iOS 8
Automated - UI & Functional Regression on iPad 2 running iOS 8
Automated - Under the Hood: iPad Air on iOS 8
Automated - AU/NZ: iPad Air running iOS 8
Automated - DRM iPadAir running iOS 8
Here is JS var:
var dump = test.name //test.name = "Automated - UI & Functional........"
How do I fetch the specific content in this dump var such as UI & Functional, iPhone 6, iOS, 9 and assign each of them to different var further and finally print? Here 9 is the OS version.
Idea is to print eventually in JS as:
Type: UI & Functional regression
Phone: iPhone 6
OS: iOS
OS version: 9
Similarly for other above mentioned strings.
What I tried or can think of:
1. Use the JS split() function
2. Is it possible to put the var string content in an array and then split()?