Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Scripts/QuoteWrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
{
"api":1,
"name":"Wrap Characters in Quotes",
"description":"Split string into characters, wrap in quote marks, and make new string",
"author":"Andy",
"icon":"hurricane",
"tags":"quote, split, string, characters"
}
**/

function main(state) {
try {
let string = state.text;
let arrayFromString = Array.from(string);
let newString = arrayFromString.join("', '");
let fixedString = "'" + newString + "'";
state.text = fixedString;
}
catch(error) {
state.postError("Something messed up happened when trying to wrap the characters!")
}
}