With JavaScript’s String.prototype.split
function:
var input="john smith~123 Street~Apt 4~New York~NY~12345";
var fields = input.split('~');
var name = fields[0];
var street = fields[1];
// etc.
Related Contents:
- “Thinking in AngularJS” if I have a jQuery background? [closed]
- Where can I find documentation on formatting a date in JavaScript?
- How do I promisify native XHR?
- string.charAt(x) or string[x]?
- How to create a JavaScript callback for knowing when an image is loaded?
- JavaScript query string [closed]
- Parse JSON String into a Particular Object Prototype in JavaScript
- Promise vs setTimeout
- preventDefault() on an tag
- What’s the cause of the error ‘getaddrinfo EAI_AGAIN’?
- Set HTTP header for one request
- Is there a jQuery autogrow plugin for text fields?
- How can I get the content of the file specified as the ‘src’ of a tag?
- The invocation context (this) of the forEach function call
- How can I show a hidden div when a select option is selected?
- Search recursively for value in object by property name
- async for loop in node.js
- Want HTML form submit to do nothing
- Using &&’s short-circuiting as an if statement?
- is it possible to open a popup with javascript and then detect when the user closes it?
- Cross domain POST request is not sending cookie Ajax Jquery
- Import JSON file in React
- In Android Webview, am I able to modify a webpage’s DOM?
- Break statement in javascript array map method [duplicate]
- File Upload without Form
- Discord.js v13 code breaks when upgrading to v14
- Authorization of Google Drive using JavaScript
- Create a and fill it based on a passed array
- sort json object in javascript
- Javascript regex (negative) lookbehind not working in firefox
- How can I stop the alpha-premultiplication with canvas imageData?
- Python library for rendering HTML and javascript [closed]
- What events does an fire when its value is changed?
- Using ‘let’ as a variable name is not throwing any errors in google v8
- Pseudo-classical inheritance with privacy?
- Why is PassportJS in Node not removing session on logout
- How can I bind the html content in vuejs?
- Test if links are external with jQuery / javascript?
- How to disable beforeunload action when user is submitting a form?
- Display image from blob using javascript and websockets
- Set the default value of an input field
- Zip arrays in JavaScript?
- fancybox bug with trigger click
- Javascript oddness with array of objects and indexOf
- getting the last item in a javascript object
- Active Menu Highlight CSS
- Angular 2 typescript invoke javascript function
- how to get request path with express req object
- What is the difference between window, window.top and window.parent?
- You’re importing a component that needs useState. It only works in a Client Component, but none of its parents are marked with “use client”