How to replace string in bytes object with Python

1 Answer

0 votes
b = b"pythonjava"

print(b)

b = b.replace(b"java", b"c++")

print(b)


    
    
'''
run:
  
b'pythonjava'
b'pythonc++'
     
'''

 



answered Sep 15, 2020 by avibootz

Related questions

1 answer 169 views
1 answer 166 views
1 answer 236 views
1 answer 238 views
238 views asked Sep 7, 2018 by avibootz
...