changes the substring to confirm with alphabetical order