Welcome to Dream.In.Code
Click Here
Getting Help is Easy!

Join 118,883 Programmers for FREE! Ask your question and get quick answers from experts. There are 2,039 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Filter strings with split() method

 
Reply to this topicStart new topic

Filter strings with split() method, How do I fillter out un-wonted data

Ragemaster
post 22 Jun, 2008 - 05:30 PM
Post #1


New D.I.C Head

*
Joined: 22 Jun, 2008
Posts: 1

/*This is the array of slpit() data into elements

var allWords:Array = new Array();
var wordString:String = event.target.data;
allWords = wordString.split(/?*,/);

each line bellow is the elements for allWords:Array

allWords[0]= "*1.DGN MIN_MAX TABLES (1.DGN)"
[1]= ".50,6
[2]= "1,6"
[3]= "2,6"
[4]= "3,6"
[5]= "5,0"
[6]= "10,1"
[7]= "*THIS NEXT LINE IS THE DELIMITER FOR THE MAX TABLES"
[8]= "<>"
[9]= "25"
[10]=" 50"
[11]= "100"
[12]= "200"
[13]= "300"
[14]= "500"
[15]= "1000"
*/

what I need is to break this data into three separate arrays containg only valid numbers with no text in the line
the first is called

var mins:int = (allWords[?] only text lines with numbers left of the ",");
var minColor:int = ((allWords[?] only text lines with numbers right of the ",");
var max:int = ((allWords[?] only text lines with numbers with no "," ether the left or right of)

How do I grab only the data I wont in each element of and Array?

This post has been edited by Ragemaster: 22 Jun, 2008 - 08:05 PM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/13/08 03:03AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month