string vxp_digest = line.Substring(idx - 32, idx); works but string vxp_digest = line.Substring(idx - 33, idx - 1); does not tested in c# Regards