We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turing a block of text into an array where each line is an element would be useful.
I currently use https://arraythis.com/ for that.
The text was updated successfully, but these errors were encountered:
I ended up throwing together a little custom script to do this:
function main(state) { const lines = state.text.split('\n'); const output = lines .filter(line => line.trim() !== '') .map((line) => ` ${(Number.isNaN(Number.parseFloat(line)) ? `'${line}'` : Number.parseFloat(line))}`) .join(',\n'); state.fullText = `[\n${output}\n]`; state.postInfo(`${lines.length} array items converted`); }
This also checks if something is a string or a number and preserves the type too.
Sorry, something went wrong.
No branches or pull requests
Turing a block of text into an array where each line is an element would be useful.
I currently use https://arraythis.com/ for that.
The text was updated successfully, but these errors were encountered: