<p>I have this string</p>

<pre><code>'john smith~123 Street~Apt 4~New York~NY~12345'
</code></pre>

<p>Using JavaScript, what is the fastest way to parse this into</p>

<pre><code>var name = "john smith";
var street= "123 Street";
//etc...
</code></pre>

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.
```
```