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 2]: The function split() creates an array of strings by splitting str wherever " " occurs. ... // JavaScript Program to illustrate split() function let str = 'It is a 5r&amp;e@@t Day.' let array = str.split(" "); console.log(array);
Published   December 27, 2017
🌐
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."]
🌐
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:
🌐
Js
split.js.org
Split.js
We cannot provide a description for this page right now
Find elsewhere
🌐
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' ]
🌐
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.
🌐
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.
🌐
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.
🌐
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 - In this example, 'hello world javascript'.split(' ') produces ['hello', 'world', 'javascript']. This method preserves the original words exactly as they appear, including any punctuation attached to them.
🌐
TechOnTheNet
techonthenet.com › js › string_split.php
JavaScript: String split() method
We have written the output of the ... we used a space character as the delimiter. In this example, the split() method returned an array of 4 elements consisting of the strings 'Tech', 'On', 'The', and 'Net'....
🌐
TutorialsPoint
tutorialspoint.com › home › javascript › javascript string split method
JavaScript String Split Method Explained
September 1, 2008 - <html> <head> <title>JavaScript String split() Method</title> </head> <body> <script type = "text/javascript"> var str = "Apples are round, and apples are juicy."; var splitted = str.split(" ", 3); document.write( splitted ); </script> </body> ...
🌐
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.
🌐
SheCodes
shecodes.io › athena › 514597-understanding-the-split-method-in-javascript-with-examples
[JavaScript] - Understanding the split Method in JavaScript with Examples
Learn how the split method works in JavaScript to divide strings into arrays. ... Im learning about the AJAX thing in the API thing and I am so confused. I'm really confused about how API exactly works and what exactly AJAX and Axios means. I'm really confused. What is this thing and where do I find it? can you explain this really easily and simply for me like explain as if I'm a child. Give easy real life examples ...