You can try for this
public String rotateStringCW(String str, int no){
int N=str.length();
String str1= str.substring(N-no,N)+str.substring(0,N-no);
return str1;
}