I threw together this "List to String" web page for myself earlier this year, and I use it almost daily. It sounds like it might be what you're looking for. Paste your list in the top, say what you want to use to prefix, suffix and separate each item in the list, and hit the button. When you hit the button, you your list will get "converted" as you've prescribed and put in the bottom box. You can then copy and paste it into a QBE field or wherever.
I paste the code here with no warranty or support of any sort. Use it at your own risk and pleasure.
Copy the code below into a text file with a .html extension, then open the file in your favorite browser and enjoy. (I use it in Chrome.)
<!DOCTYPE html>
<html>
<head><title>List to String</title></head>
<script language="JavaScript">
function list2Csv() {
var input = document.getElementById("list").value;
if (!input) { return; }
var stringPrefix = document.getElementById("itemPrefix").value;
if (stringPrefix == null) {stringPrefix = "";}
var stringSuffix = document.getElementById("itemSuffix").value;
if (stringSuffix == null) {stringSuffix = "";}
var stringSep = document.getElementById("itemSep").value;
if (stringSep == null) {
stringSep = "";
} else if (stringSep == "\\n") {
// user wants newlines
stringSep = "\n";
}
stringSep = stringSuffix + stringSep + stringPrefix
// dedup thanks: https://stackoverflow.com/a/9229821/5368626
var listData = [...new Set(input.split("\n").sort())];
document.getElementById("output").value = stringPrefix + listData.join(stringSep) + stringSuffix;
}
</script>
<body>
<h1>List to (sorted, deduped) String</h1>
<div>
<label>List</label>
<br>
<textarea id="list" cols="80" rows="25" scroll></textarea>
</div>
<div>
<div style="display: inline">
<ul>
<li><label>Prefix: </label><input type="text" id="itemPrefix"/></li>
<li><label>Suffix: </label><input type="text" id="itemSuffix"/></li>
<li><label>Separator: </label><input type="text" id="itemSep"/></li>
</ul>
</div>
<div style="display: inline">
<button default="true" onclick="list2Csv()">List to String</button>
</div>
</div>
<div>
<label>String (sorted, duplicates removed)</label>
<br>
<textarea id="output" cols="80" rows="25" scroll></textarea>
</div>
</body>
</html>