in Education by
This question already has answers here: How to split a string with angularJS (4 answers) Closed 5 years ago. I wanted to split a string and get the string in two parts. for example: www.medicoshere.com/register.html?23457cedlske234cd i wish to split the string in the above url and store the string that is after the ? to a variable. How can i do that. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
var str = "www.medicoshere.com/register.html?23457cedlske234cd"; var res = str.split("?"); var value = res.slice(-1).pop(); // it will give 23457cedlske234cd

Related questions

0 votes
    This question already has answers here: How to split a string with angularJS (4 answers) Closed 5 years ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: How to split a string with angularJS (4 answers) Closed 5 years ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: When to use ":"(colon) operator in javascript vs "=" operator ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: When to use ":"(colon) operator in javascript vs "=" operator ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I'm new to JavaScript. I have the following object: let obj1 = [{ 'id': 1, 'longString': ' ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I'm new to JavaScript. I have the following object: let obj1 = [{ 'id': 1, 'longString': ' ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    What's the best way to extract the key and value from a string like this: var myString = 'A1234= ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 9, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: How to access the correct `this` inside a callback (13 answers) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    This question already has an answer here: Object.assign getters and setters in constructor (1 answer) Closed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    This question already has an answer here: Object.assign getters and setters in constructor (1 answer) Closed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: JavaScript: Difference between .forEach() and .map() (15 answers) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I'm trying to use the sensor's API with react and I can't seen to be able to make it work ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I'm trying to use the sensor's API with react and I can't seen to be able to make it work ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 10, 2022 in Education by JackTerrance
0 votes
    I created a raycaster that allows me to pick an object from the scene with my mouse like such: ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I have a function that has more than 1400+ crypto pairs and I have to send an API against each ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 5, 2022 in Education by JackTerrance
...