Last active
January 26, 2016 02:46
-
-
Save DexterHaslem/1b6a5fc1d5e44917be88 to your computer and use it in GitHub Desktop.
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
soh = Char(0x01) | |
function fix_parse_idx(str) | |
ret = [] | |
prev_idx = 1 | |
for idx in 1 : length(str) | |
# beware julia indexing starts at 1!! | |
if str[idx] == soh && idx > 1 | |
# we want to match parse_split so dont include SOH | |
chunk = str[prev_idx:idx - 1] | |
if length(chunk) > 0 | |
push!(ret, chunk) | |
end | |
prev_idx = idx + 1 | |
end | |
end | |
return ret; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment