Skip to content

Instantly share code, notes, and snippets.

@matepaiva
Last active October 3, 2018 21:08
Show Gist options
  • Save matepaiva/a2b96ecc78311ff353ee79fce1fae36b to your computer and use it in GitHub Desktop.
Save matepaiva/a2b96ecc78311ff353ee79fce1fae36b to your computer and use it in GitHub Desktop.
Parse bank transaction sms string to mapped object
const getValueBetween = (str) => (startDelimiter, endDelimiter) =>
str.split(startDelimiter).pop().split(endDelimiter).shift().trim();
const getValueStartingAt = (str) => (startDelimiter, numberOfChars = Infinity) =>
str.split(startDelimiter).pop().slice(0, numberOfChars).trim();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment