Last active
September 11, 2018 12:18
-
-
Save MaxySpark/98ec3282a85fd7ee0305aeaa7725feab to your computer and use it in GitHub Desktop.
Slice Helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| Author : MaxySpark <me@maxyspark.me> | |
| */ | |
| function sliceHelper(str,object) { | |
| let keys = Object.keys(object); | |
| let return_obj = {}; | |
| keys.forEach(function(key) { | |
| let start = object[key][0]-1; | |
| let char_count =start+object[key][1]; | |
| return_obj[key] = str.slice(start,char_count); | |
| }) | |
| return return_obj; | |
| } | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://rawgit.com/MaxySpark/98ec3282a85fd7ee0305aeaa7725feab/raw/a68927edfb302214f4d205ebcfe0b416da4f9da6/sliceHelper.js