Skip to content

Instantly share code, notes, and snippets.

@takvol
takvol / gist:0a0dd9b089314bc5463eaf6af83fa060
Last active January 18, 2023 16:31 — forked from siygle/gist:9678772
Parse Gmail Inbox to sheet
function extractData(data, startStr, endStr) {
// This function extracts text between two strings
// i.e. extractData("Good_news,_everyone!", "Good_", ",_Everyone!") will return "News"
var startIndex, endIndex, text = 'N/A';
startIndex = data.indexOf(startStr);
if(startIndex != -1) {
startIndex += startStr.length;
text = data.substring(startIndex);