Created
January 19, 2018 11:57
-
-
Save mattmawhinney/d77c8ec16c4989f823eb50d7ade21660 to your computer and use it in GitHub Desktop.
Custom Code for Google Sheets Function
This file contains 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
function corSPLIT(input) { | |
function splitValue(value, index) { | |
//console.log(value.substring(0, index+1) + "#" + value.substring(index+1)); | |
return value.substring(0, index+1) + "#" + value.substring(index+1); | |
} | |
var corNumA = input.split(""); | |
//console.log(corNumA); | |
var splitSpot; | |
for (i = 0; i < corNumA.length; i++) { | |
var curr = corNumA[i]; | |
var next = corNumA[i+1]; | |
if (curr == "0") { | |
if (next != "0" && next != "1" && next != "2" && next != "3" && next != "4" && next != "5" && next != "6" && next != "7" && next != "8" && next != "9") { | |
var splitSpot = i; | |
{ break; } | |
} | |
} | |
} | |
//console.log(splitSpot); | |
splitValue(corNum,splitSpot); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment