Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Decoding string

Reply
Thread Tools

Decoding string

 
 
Sonnich
Guest
Posts: n/a
 
      10-11-2006
Hi all!

Simple question, but I haven't used JS for a long time.

I get a string, like "1,3" and need to read out the numbers 1 and 3. I
can change the separator if needed, but all I want to is to send to
numbers in a string, then decode them

TIA
Sonnich

 
Reply With Quote
 
 
 
 
zman
Guest
Posts: n/a
 
      10-11-2006

Sonnich wrote:
> Hi all!
>
> Simple question, but I haven't used JS for a long time.
>
> I get a string, like "1,3" and need to read out the numbers 1 and 3. I
> can change the separator if needed, but all I want to is to send to
> numbers in a string, then decode them
>
> TIA
> Sonnich


Try this
var str="1,2,3,4";
var str_array=str.split(",");

Array str_array contains the list of all the values.

zafar

----------------------------------------------------
http://www.vbuniverse.com/sphones.html
http://sphones.blogspot.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am facing an issue while decoding json string using json.loads sajuptpm Python 2 12-28-2012 07:16 AM
Decoding the string sumit Java 0 03-10-2012 07:43 AM
String Manipulation Problems (decoding hex) Oreo Shake Ruby 4 01-28-2010 08:26 PM
Problem with decoding a compressed string keith_g Ruby 1 12-03-2007 02:53 AM
query string encoding/decoding =?Utf-8?B?TWFyaw==?= ASP .Net 7 04-05-2004 04:02 PM



Advertisments