Hey there! any question in your mind? Ask It Now!.

Popular Categories





get multiple bytes from a string

+6 votes
67 views
asked in Programming by mHelpMe (670 points)

How can i get multiple bytes from a string is too bulky.,i am using this but its too long

i need simple solution for it

var ticket = data[H]
piece += data[H+1]+data[H+2]+data[H+3]+data[H+4]+data[H+5]+data[H+6]
+data[H+7]+data[H+8]+data[H+9]+data[H+10]+data[H+11]+data[H+12]
+data[H+13]+data[H+14]+data[H+15]

1 Answer

0 votes
answered by mika (1,290 points)

You can try to have a string ticket that contains the 16 bits from H to H+15 try:

var ticket = data.slice(H, H+16);

For slice 

 

Related Questions

+2 votes
2 answers 809 views
–1 vote
0 answers 153 views
+2 votes
1 answer 177 views
+3 votes
1 answer 808 views
+6 votes
2 answers 2,954 views
+4 votes
5 answers 770 views
+1 vote
1 answer 175 views
0 votes
1 answer 201 views
+1 vote
1 answer 121 views
+1 vote
1 answer 908 views

Not a Member yet?

Ask to Folks Login

My Account
694 Folks are online
6 members and 688 guest online
Your feedback is highly appreciated