You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var parse = function (text) { var first = true; var result = " State ("; let englishcolonfrenchArray = text.split("\n\n"); console.log(englishcolonfrenchArray); for (const item in englishcolonfrenchArray) { console.log(item); let pair = englishcolonfrenchArray[item].split(':'); console.log(pair); result += "French \"" + pair[1].trim() + "\", English \"" + pair[0].trim() + "\""; if (first) { result += ", [ ("; first = false; } else { result += "); ("; } } return result.substring(0, result.length - 4) + ") ])"; }
\\ in console...var input = `<paste text here>`; then parse(input)