|
-
Aug 24th, 2010, 08:02 AM
#1
Thread Starter
Registered User
[RESOLVED] Javascript split on only first space
I guess this is a stupid questen but I cannot find a solution. What I want is to split a string, but with a limit. Say I have the following string:
20 nice cookies
I'd like to get an array containing:
20
nice cookies
Splitting with a space returns 3 elements, and with a limit of 1 it returns 1 element (20), and the rest is discarded. How do I accomplish what I want?
Thanks.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|