public class Demo11 {
	public static String LeftRotateString(String str, int k) {
		if( k <=0 ) {
			return str;
		}
		
		int offset = k%str.length();
		
		String temp = str+str;
		
		int start = str.length()-k;
		int end = str.length()-1+ (str.length()-k)+1;

		
		
		return temp.substring(start,end);

	}
	
	public static void main(String[] args) {
		System.out.println(LeftRotateString("abcd", 2));
	}
}
仅供参考,不知道合不合题意