Click Here To Get Amazing Facebook Profile Covers,Status Messages

How to split a string in javascript

1 reply [Last post]
angel's picture
angel
User offline. Last seen 2 years 39 weeks ago. Offline
Joined: 08/22/2009

i Have a string i want to separate it into multiple substrings separated by space separator.Is there any way to use multiple separators in one operation.


rajesh's picture
rajesh
User offline. Last seen 12 weeks 6 days ago. Offline
Joined: 08/17/2009
The split() method in

The split() method in javascript is used to split a string it returns an array of substrings

string.split(separator, limit)

Both parameters are optional.
separator Specifies the character to use for splitting the string. If not provided the entire string will be returned
limit specifies the number of splits or the returned array size its an integer value