Skip to content

Instantly share code, notes, and snippets.

@DexterHaslem
Last active January 26, 2016 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DexterHaslem/1b6a5fc1d5e44917be88 to your computer and use it in GitHub Desktop.
Save DexterHaslem/1b6a5fc1d5e44917be88 to your computer and use it in GitHub Desktop.
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