Hello, I am trying to write a simple sort string without using the array sort method. But it's not working. please help

Code:
 public static String sort(String s) {
    	StringBuffer s1 = new StringBuffer(s);
    	s1.sort();
    	return s1.toString();
    }