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 char
s 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
Post a Comment