Documentation can be found e.g. at MDN. 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 -- something_else';
var substr = str.split(' -- ');
// substr[0] contains "something"
// substr[1] contains "something_else"

If this value is in some field you could also do:

tRow.append($('<td>').text(=txtEntry2]').val().split(' -- ')[0])));

Answer from Felix Kling on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › split
String.prototype.split() - JavaScript | MDN
In the following example, split() looks for zero or more spaces, followed by a semicolon, followed by zero or more spaces—and, when found, removes the spaces and the semicolon from the string.
🌐
W3Schools
w3schools.com › jsref › jsref_split.asp
JavaScript String split() Method
If (" ") is used as separator, the string is split between words. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-string-split-method
JavaScript String split() Method - GeeksforGeeks
[Example 1]: The split() function divides the string "Geeks for Geeks" at "for", creating an array with two parts: ['Geeks ', ' Geeks']. It separates based on the given delimiter.
Published   December 27, 2017
🌐
CoreUI
coreui.io › answers › how-to-split-a-string-by-spaces-in-javascript
How to split a string by spaces in JavaScript · CoreUI
September 23, 2025 - const sentence = 'hello world javascript' const words = sentence.split(' ') // Result: ['hello', 'world', 'javascript'] The split(' ') method divides the string at each space character, creating an array where each word becomes a separate element.
🌐
Medium
medium.com › nerd-for-tech › basics-of-javascript-string-split-method-4647aa1b0f4e
Basics of Javascript · String · split() (method) | by Jakub Korch | Nerd For Tech | Medium
June 20, 2021 - Capital H at the beginning of the string fits this condition, so the split creates empty space as a first element of the resulting array. There is some counterintuitive behavior when it comes to the regular expressions that I should mention. If separator is a regular expression with capturing parentheses, then each time separator matches, the results (including any undefined results) of the capturing parentheses are spliced into the output array. Let’s see the behavior in the second example.
🌐
ReqBin
reqbin.com › code › javascript › wyqvcilw › javascript-split-string-example
How do I split a string in JavaScript?
The following is an example of splitting a string by capital letters using the split() method and specifying a Regular Expression as the delimiter: JavaScript Split Strings by Capital Letters Example
🌐
Sentry
sentry.io › sentry answers › javascript › split a string in javascript
Split a string in JavaScript | Sentry
const myString = "This is a sentence."; const words = myString.split(/(?= )/); // split on but retain single space characters console.log(words); // will output ["This", " is", " a", " sentence."]
🌐
freeCodeCamp
freecodecamp.org › news › javascript-split-how-to-split-a-string-into-an-array-in-js
JavaScript Split – How to Split a String into an Array in JS
June 16, 2021 - There could be cases where you may have passed a splitter that is not part of the string or doesn't match any part of it. In that case, the split() method returns an array with the entire string as an element. In the example below, the message string doesn't have a comma (,) character.
Find elsewhere
🌐
Js
split.js.org
Split.js
We cannot provide a description for this page right now
🌐
Programiz
programiz.com › javascript › library › string › split
JavaScript String split()
// divides the message string at :: let result = message.split("::"); console.log(result); // Output: [ 'JavaScript', 'is', 'fun' ]
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript string methods › string.prototype.split()
JavaScript String split(): Splitting a String into Substrings
November 3, 2024 - Use the JavaScript String split() method to split a string into an array of substrings by a separator.
🌐
Medium
medium.com › @ryan_forrester_ › javascripts-split-method-everything-you-need-to-know-9c669eb5f626
JavaScript’s Split Method: Everything You Need to Know | by ryan | Medium
November 19, 2024 - This code first splits the URL at the question mark to isolate the query parameters, then splits each parameter pair and creates an object for easy access to the values. A practical example of formatting names from various input formats:
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Symbol › split
Symbol.split - JavaScript | MDN
The String.prototype.split() method looks up this symbol on its first argument for the method that splits a string at the indices that match the current object.
🌐
Tabnine
tabnine.com › home › how to use split in javascript
How to Use split in JavaScript - Tabnine
July 25, 2024 - After three splits have taken place, the function has finished its job, and an array consisting of the first three substring elements is returned. ... In our first example above, we called the split() method with no parameter, and assigned the result to arrCopy...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › RegExp › Symbol.split
RegExp.prototype[Symbol.split]() - JavaScript | MDN
This method is called internally in String.prototype.split() when a RegExp is passed as the separator. For example, the following two examples return the same result.
🌐
Built In
builtin.com › software-engineering-perspectives › split-string-javascript
How to Split a String in JavaScript | Built In
Summary: The JavaScript split() method divides a string into an array of substrings using a specified delimiter. It can be used for tasks like parsing CSV data, extracting URL components or reversing strings, and supports an optional limit on ...