![]() |
| ||
| breaking a string block into list form My problem is I have a cache file that I'm pulling in from a seperate source. The cache contains a long string that would look something like this except much longer. myexample=1 status=0 timesHit=2500 Basically I need help figuring out how to break this up into myexample=1 status=0 timesHit=2500 The java code is written inside of html code but I know the html code well enough. I don't think this is overly complicated but I just can't seem to get it to work. <% the bolded part is the part i've edited. Everything else should be correct. The bold part is the part I'm having trouble with. The bold is very wrong but I have been trying to figure this out for many hours so this is desperation code. The original code looked like this so that you can see the parts i have screwed up. <% the bolded cache is what i change and where i need to add the new code. |
| ||
| Re: breaking a string block into list form I hope this doesn't sound too newby but have you tried looking into String Tokenizer? i'm assuming the information is in Strings so you can learn the StringTokenizer class to seperate your string based on a " " or space token. Oh wait it looks like you're using Javascript... I don't know of any JavaScript classes/functions to help you X_X |
| ||
| Re: breaking a string block into list form You do not need to use "split()" in a for loop <% Just use this code instead:- <%Note:- I have commented out the for loop here And by the have you noticed how you are using the "parts" object(in the for loop) before actually declaring it (which is inside the loop). |
| All times are GMT -4. The time now is 7:30 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC