Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Find Quotes by mortonfox
"use strict";
function findQuotes(a) {
return (a.match(/"[^"]*"/g) || []).map(s => s.substring(1, s.length - 1));
}
// var assert = require('assert');
// if (!global.is_checking) {
// console.log('Example:');
// console.log(findQuotes('"Greetings"'));
// // These "asserts" are used for self-checking and not for an auto-testing
// assert.deepEqual(findQuotes('"Greetings"'), ['Greetings']);
// assert.deepEqual(findQuotes('Hi'), []);
// assert.deepEqual(findQuotes('good morning mister "superman"'), ['superman']);
// assert.deepEqual(findQuotes('"this" doesn\'t make any "sense"'), ['this', 'sense']);
// assert.deepEqual(findQuotes('"Lorem Ipsum" is simply dummy text ' +
// 'of the printing and typesetting ' +
// 'industry. Lorem Ipsum has been the ' +
// '"industry\'s standard dummy text ' +
// 'ever since the 1500s", when an ' +
// 'unknown printer took a galley of ' +
// 'type and scrambled it to make a type ' +
// 'specimen book. It has survived not ' +
// 'only five centuries, but also the ' +
// 'leap into electronic typesetting, ' +
// 'remaining essentially unchanged. "It ' +
// 'was popularised in the 1960s" with ' +
// 'the release of Letraset sheets ' +
// 'containing Lorem Ipsum passages, and ' +
// 'more recently with desktop ' +
// 'publishing software like Aldus ' +
// 'PageMaker including versions of ' +
// 'Lorem Ipsum.'), ['Lorem Ipsum',
// "industry's standard dummy text ever " +
// 'since the 1500s',
// 'It was popularised in the 1960s']);
// assert.deepEqual(findQuotes('count empty quotes ""'), ['']);
// console.log("Coding complete? Click 'Check' to earn cool rewards!");
// }
Aug. 13, 2020
Comments: