You could add a filter to exclude the empty string.
var string = 'a,b,c,d,e:10.';
var array = string.split ('.').filter(function(el) {return el.length != 0});
More Related Contents:
- How can I split a string into segments of n characters?
- Javascript Array – Split string at numbers [closed]
- Split array into chunks
- Is there a built in way to convert a comma-separated string to an array?
- How to get character array from a string?
- Why is [1,2] + [3,4] = “1,23,4” in JavaScript?
- How to check if a string contains text from an array of substrings in JavaScript?
- Split large string in n-size chunks in JavaScript
- How to find if an array contains a specific string in JavaScript/jQuery?
- How can I convert a comma-separated string to an array?
- Convert string with commas to array
- How to convert array into string without comma and separated by space in javascript without concatenation?
- How to sort an array based on the length of each element?
- How to check if a string array contains one string in JavaScript? [duplicate]
- How to convert hex string into a bytes array, and a bytes array in the hex string?
- Convert javascript array to string
- Remove empty strings from array while keeping record Without Loop?
- JavaScript split String with white space
- Split a string based on multiple delimiters
- Replace string in javascript array
- Trying to capitalize the first character in array of strings, why this is not working?
- Remove occurrences of duplicate words in a string
- How can I get a character array from a string?
- split an array into two based on a index in javascript
- Unicode string with diacritics split by chars
- javascript – Convert array to string while preserving brackets
- How to count the number of lines of a string in javascript
- Accesing 2d arrays from Javascript [closed]
- Pass a string by reference in Javascript
- javascript – match string against the array of regular expressions