# Parts of a string into an array

**URL:** <https://forum.kirupa.com/t/parts-of-a-string-into-an-array/253983>\
**Category:** programming\
**Created:** [March 6, 2008, 11:55pm UTC](https://forum.kirupa.com/t/parts-of-a-string-into-an-array/253983 "2008-03-06T23:55:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![slackr15](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@slackr15](https://forum.kirupa.com/u/slackr15)\
**Post date:** [March 6, 2008, 11:55pm UTC](https://forum.kirupa.com/t/parts-of-a-string-into-an-array/253983/1 "2008-03-06T23:55:04Z")

</div>

I’m looking for a good way to grab the names, the colors, and the numbers from a string and place them in an array. Here’s the string:

El Norte Pkwy class=“green” 70 mph  
Valley Pkwy class=“green” 59 mph  
Auto Park Way class=“green” 65 mph  
Felicita/Citracado Pkwy class=“green” 55 mph  
Centre City Pkwy class=“green” 75 mph  
Pom/W Bernardo Dr class=“yellow” 48 mph  
Rho Bernardo Rd class=“yellow” 47 mph  
Bernardo Center class=“green” 60 mph  
Camino del Norte class=“green” 64 mph  
Carmel Mtn Rd class=“green” 62 mph

The only way I know would be looping and finding white spaces but not sure how.  
Any suggestions are much appreciated!
