Javascript - split ()

Last update on July 15, 2009 10:55 AM by deri58
Published by jad05

[Javascript] The split () function






The split () function allows you to split a string and return the results in a table, using a string defined as a separator.

In the example below, the split () can cut the date according to the character '/':

var date = '26/02/2009';
var elem = uneDate.split('/');
day = elem[0];
month = elem[1];
year = elem[2];
Best answers for « Javascript split () » in :
Escape an apostrophe under javascript Show Escape an apostrophe under javascript In Javascript, an apostrophe (single quote) into a string itself enclosed by apostrophes cause an error. To troubleshoot, you should escape the apostrophe by heading the backslash character to get...
Download PDF SaM (Split and Merge) Show PDFsam is a tool to merge and cut PDF files. It is an open source application to treat PDF files. It requires Virtual Java machine 1.4.2 or superior version. With a simple and intuitive interface, you can: - split documents PDF into chapters, into...
Javascript - trim() function Show[Javascript] The trim() function The trim () function is native PHP (and other languages) and is used to remove the spaces at the beginning and end of the string. There is no such function in Javascript, but you can use the...
[Javascript]Knowing the height of an HTML element Show[Javascript]Knowing the height of an HTML element To determine the height of a HTML block using JavaScript, independently from the type browsers used, there are two methods: element.offsetHeight...
Popup in CSS without Javascript ShowPopup in CSS without Javascript Here's how to make a popup information in pure CSS, [no Javascript used]. Use :hover so as to use different CSS when moving the cursor. Among the modified CSS attributes, use display:none to...
Download Split Browser ShowTo compare web pages, all the windows containing the pages must be opened and you must try to resize them to place them side by side. This task is rather hard and not very intelligent. Split Browser is a Firefox extension allowing to split the pages...
HTML forms ShowForms Interactive forms let web page authors give their pages interactive elements, such as for receiving messages from their readers, much like the reply cards found in some magazines. The reader enters information by filling in fields or clicking...
Creating an RJ45 crossover cable ShowWhat's an RJ45 plug? A network card may have several types of connectors, with the most common being: An RJ45 connector; A BNC connector (coaxial cable). The RJ-45 is the one which interests us here, as it it the most widely used. The cables...
MIME (Multipurpose Internet Mail Extensions) ShowIntroduction to MIME MIME (Multipurpose Internet Mail Extensions) is a standard which was proposed by Bell Communications in 1991 in order to expand upon the limited capabilities of email, and in particular to allow documents (such as images,...