How to find the index of specific character in bytearray in Python

1 Answer

0 votes
ba = bytearray(b"pythonjava")
 
i = ba.find(b"h")
print(i)
    

i = ba.find(b"z")
print(i)


    
'''
run:
  
3
-1
     
'''

 



answered Sep 15, 2020 by avibootz
...