local file = io.open("lorem.txt")
local t = string.lower(file:read("*all"))
file:close()
for word in t:gmatch("%a+") do
local count = 0
for _ in t:gmatch(word) do
count = count + 1
if count == 2 then
break
end
end
if count == 1 then
print(word)
break
end
end
var preInner = pre.innerHTML.replace(/[.,\/#!$%\^&\*;:{}=\-_`~()]/g,""); // Remove punctuation.
preInner = preInner.replace(/\r?\n|\r/g, " "); // Remove all newline carriages
var myArray = preInner.split(" "); // Split into array
var sorted = myArray.slice().sort(); // Sort it alphabetically
var newArray = []; // Results array
var count = 0;
// If the current one is same as the next one - increase count.
for (var i =0; i < sorted.length -1; i++){
if(sorted[i] == sorted[i+1]){
count++;
} else { // If the next one is a new one, check the count
if(count > 0){ // There more than one previous one, reset the count and reloop
count = 0;
} else { // Only one counted current and reached now one? - Add to results array
newArray.push(sorted[i]);
count = 0;
}
}
}
newArray