Shifting binary bits left in Java -


i having bit of trouble shifting of string in java. have stringbuilder called finalbinary contains string of binary bits, "00110101" , trying shift left 5 times, so;

input: 00110101

output: 10100110

i have been reading bitinversion on oracle website , of forums on here, having no luck :( appreciate help, thankyou guys! :)

what describing rotating not shifting. not rotating bits manipulating string of chars happen represent binary. "abcdefg" => "efgabcd" far computer concerned.

public static string rotatechars(string str, int count) {     count % = str.length();     return str.substring(count) + string.substring(0, count); } 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

html - href attribute breaking an element -