txt.length = 72
txt.length - (sep+sep).length = 70
So txt.indexOf((sep+sep), txt.length - (sep+sep).length) = txt.indexOf('||', 70) = -1 after that fist disk is outputted only.
I think should be something like:
if (txt.indexOf(sep+sep) > 0)
instead of:
if (txt.indexOf((sep+sep), txt.length - (sep+sep).length) >= 0)
About code:
My netcat output:
I think something wrong in first condition.
txt.length
= 72txt.length - (sep+sep).length
= 70 Sotxt.indexOf((sep+sep), txt.length - (sep+sep).length)
=txt.indexOf('||', 70)
=-1
after that fist disk is outputted only.I think should be something like:
instead of:
How do you think? Thank you!