Question: I want to replace second space occurrence of the sentence with a br.

I have tried this but it is deleting the rest.

```
var title = "My Title Needs Brace".split(" ").slice(0, 2).join(" ");

```

Answer: 
Try the following:

```js
var title = "My Title Needs Brace".split(" ");

title.forEach(function(item, i, title){
  if(i==1)
    title[i] += "<br/>";
  else
  title[i] += ' ';
})

console.log(title.join(''));
```
***maybe that will help :***

```
var title = "My Title Needs Brace".split(" ");
t1=title [0]; My
t2=title[1]; // Title 
t3=title[2]; // Needs 
t4=title[3]; // Brace

```

**you can drew here anything :**

```
var htmlString = '' + t1 +''+ t2 + '<br />' +  t3 +''+ t4 + '';
$('Anywhere').append(htmlString);

```