Question: I'm trying to change default language of website from "en" to "jp".

The webpage both contain english and japanesse. 

I can't understand japanesse. But chrome translatation always suggest english translation (english to other language) first.

And I have to chage website language to japanesse to translation.

I think change website's default language can help. 

I figure chrome extension like Tampermonkey can override attribute of html.

Here's my code. 

```
// ==UserScript==
// @name default_lang
// @description change site language from en to jp
// @include         https://*siteaddress.com/*
// ==/UserScript==

document.body.innerHTML= document.body.innerHTML.replace(/xml:lang=\"en\" lang=\"en\"/g, "xml:lang=\"jp\" lang=\"jp\"");

```

Hope you could help me.

Answer: 
Hello check this version with javascript split() function that pushes every object to an array of objects:

```js
var str = "Segment Id : 82394 | Segment Name : SPA FIAT MAR 2020 LKADCLAKSC DEM (Permission)_01 | Segment Count : 0 Segment Id : 82395 |  Segment Name : SPA FIAT MAR 2020 LKADCLAKSC DEM (LeadYoung)_02 | Segment Count : 0 Segment Id : 82396 |   Segment Name : SPA FIAT MAR 2020 LKADCLAKSC DEM (LeadYoung)_03 | Segment Count : 0";
    let splitted = str.split("|");
    let nextId;
    let arrayOfObjects = [];
    for (let i = 0; i < splitted.length - 2; i = i + 2) {
      let id;
      if (i == 0) id = splitted[0].split(":")[1];
      if (i > 0) id = nextId;
      let name = splitted[i + 1].split(":")[1];
      let count = splitted[i + 2].split(':')[1].split(" ")[1];
      nextId = splitted[i + 2].split(':')[2];
      let singleObject = { SegmentId: null, SegmentName: null, segmentCount: null }
      singleObject.SegmentId = id;
      singleObject.SegmentName = name;
      singleObject.segmentCount = count;
      arrayOfObjects.push(singleObject);
    }
    console.log(arrayOfObjects);
```
I recommed using `String.split()` method. The documentation is here [Javascript Split](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split).
To illustrate, what it does:

```js
const string = "Name | Value";
var results = string.split("|");
console.log(results); // Array: ["Name ", " Value"]
```

In your case, you can start splitting the string by "\n" (Newline) then "|" and finally ":".

Hope this helps you with your problem!