Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
All-Star
43068 Points
7045 Posts
MVP
Feb 15, 2012 12:01 PM|LINK
Hi,
tripati_tutu So from this I need to get each one like, I can assign each extension to one var variable such as
Why don't you maintain an array with extentions? That's the appropriate way.
string s = "jpeg, jpg, gif, png"; var extentions[] = s.split(',');
tripati_tutu Same way if I will add more extensions to the string then accordingly I will have to get all with same var variable.
Now you can access the array by index.
e.g:- extentions[0];
Please 'Mark as Answer' if this post helps you.
Ruchira
All-Star
43068 Points
7045 Posts
MVP
Re: How to get each value from a comma separated string in javascript?
Feb 15, 2012 12:01 PM|LINK
Hi,
Why don't you maintain an array with extentions? That's the appropriate way.
string s = "jpeg, jpg, gif, png"; var extentions[] = s.split(',');Now you can access the array by index.
e.g:- extentions[0];
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.