About 128,000 results
Open links in new tab
  1. javascript - How do I split a string, breaking at a particular ...

    first we have a string seperated by '~' signs and an array of keys.The second replace function is using [^~]+ to match each different part (i.e. '123 Street', 'Apt 4', etc) and calls the function for …

  2. How do I split a string with multiple separators in JavaScript?

    Mar 16, 2009 · @BrodaNoel you're correct that's the one major caveat of the first code example. In that particular case it's best to use a character that is safe to split on, in my example the …

  3. javascript - How to use split? - Stack Overflow

    Jun 10, 2012 · Note that .split() is not a jQuery method, but a native string method. If you use .split() on a string, then you get an array back with the substrings: var str = 'something -- …

  4. javascript - How do I split a string into an array of characters ...

    The split() method in javascript accepts two parameters: a separator and a limit. The separator specifies the character to use for splitting the string. If you don't specify a separator, the entire …

  5. javascript - How can I split a string into segments of n characters ...

    Javascript: split string into strings of specific length. 2. Splits a string according to the specified ...

  6. javascript - How to split string with newline ('\n') in Node? - Stack ...

    A solution that works with all possible line endings including mixed ones and keeping empty lines as well can be achieved using two replaces and one split as follows. text.replace(/\r\n/g, …

  7. javascript - JS - Splitting a string and looping through results ...

    The string simply contains names of DIVs, like this: feedUpdateResponse = "div1/div2/div3/div4" I would like to first split the string by its slashes (/) and run a loop through the different values …

  8. javascript - Split string into array - Stack Overflow

    Do you care for non-English names? If so, all of the presented solutions (.split(''), [...str], Array.from(str), etc.) may give bad results, depending on language:

  9. JavaScript split string by regex - Stack Overflow

    Jun 12, 2013 · 1. split the array by regex to find multiple digit characters that are adjacent 2. if an item in the split array contains digits, add them together 3. join the split array items What …

  10. javascript - Split a string straight into variables - Stack Overflow

    var array = str.split('-'); var a = array[0]; var b = array[1]; var c = array[2]; Because for the code that I’m writing at the moment such a method would be a real pain, I’m creating 20 variables …

Refresh