Inist-CNRS / node-jbj

Like XSL/XML but for JSON.
http://Inist-CNRS.github.io/jbj-playground/
13 stars 3 forks source link

Add substring action #6

Closed parmentf closed 9 years ago

parmentf commented 9 years ago

For the moment, if you want to extract the month from a string "20150310", you have to mess withtruncateandshift`.

{
  "truncate": 6,
  "shift": 4
}

Maybe a substring: [offset, length] action would be more user friendly:

{
  "substring": [4,2]
}
parmentf commented 9 years ago

89d9943233648bba53412e1c66d1d8b066429cc3 made it. Will be available from v3.4.0+